Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Release Tools Bot <robert+release-tools@gitlab.com>2019-10-29 18:58:17 +0300
committerGitLab Release Tools Bot <robert+release-tools@gitlab.com>2019-10-29 18:58:17 +0300
commitcd284fef90c6c4980ecfd5e06c6344dbe7ca8b95 (patch)
tree69732f7abc5d2708e63eaeb995d86f42e4ba1e50 /app
parenta7329f4372f4e0bc2c5d9af5b6d30cb4ad94ad7d (diff)
parent84f243bc958bb12c2ee5e372f31a8d68bff4f94e (diff)
Merge branch 'security-stored-xss-using-find-file' into 'master'
Sanitize search text to prevent XSS See merge request gitlab/gitlabhq!3453
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/project_find_file.js3
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 2c375b39c1f..58f088444d0 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) {
@@ -74,7 +75,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);