diff options
author | GitLab Release Tools Bot <robert+release-tools@gitlab.com> | 2019-10-24 21:53:47 +0300 |
---|---|---|
committer | GitLab Release Tools Bot <robert+release-tools@gitlab.com> | 2019-10-24 21:53:47 +0300 |
commit | d4346598156ea498dea2f765d92b1f5b55eb8eef (patch) | |
tree | 5151ab946da9853c939ce75864a1be50989f5c17 /app | |
parent | c620b8f91759e38b429eb931eb3f75202321fb96 (diff) | |
parent | 56b8d13b1adc6946a4b107e622aadaf0d6441696 (diff) |
Merge branch 'security-stored-xss-using-find-file-12-2' into '12-2-stable'
Sanitize search text to prevent XSS
See merge request gitlab/gitlabhq!3470
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/project_find_file.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/assets/javascripts/project_find_file.js b/app/assets/javascripts/project_find_file.js index 60d3d83a4b2..bd5ab4f9ec4 100644 --- a/app/assets/javascripts/project_find_file.js +++ b/app/assets/javascripts/project_find_file.js @@ -5,6 +5,7 @@ import fuzzaldrinPlus from 'fuzzaldrin-plus'; import axios from '~/lib/utils/axios_utils'; import flash from '~/flash'; import { __ } from '~/locale'; +import sanitize from 'sanitize-html'; // highlight text(awefwbwgtc -> <b>a</b>wefw<b>b</b>wgt<b>c</b> ) const highlighter = function(element, text, matches) { @@ -75,7 +76,7 @@ export default class ProjectFindFile { findFile() { var result, searchText; - searchText = this.inputElement.val(); + searchText = sanitize(this.inputElement.val()); result = searchText.length > 0 ? fuzzaldrinPlus.filter(this.filePaths, searchText) : this.filePaths; return this.renderList(result, searchText); |