2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-23 20:40:40 +03:00

Fix XSS logic that matched some valid urls (#2529)

* Fix XSS logic that matched some valid urls, e.g. "/one/?foo=bar", when it shouldn't match those
This commit is contained in:
Yasu Flores
2019-11-07 18:39:24 -08:00
committed by GitHub
parent bbfd5b1395
commit 841466416b
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
'use strict';
module.exports = function isValidXss(requestURL) {
var xssRegex = /(\b)(on\S+)(\s*)=|javascript|(<\s*)(\/*)script/gi;
var xssRegex = /(\b)(on\w+)=|javascript|(<\s*)(\/*)script/gi;
return xssRegex.test(requestURL);
};