We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab1a5d4 commit 7aeac83Copy full SHA for 7aeac83
src/xss/sanitizeName.js
@@ -20,10 +20,10 @@
20
21
ns.on("capabilities", event => {
22
if (ns.allows("script")) {
23
- let name = ns.getWindowName();
24
- if (/[<"'\`(=:]/.test(name)) {
25
- console.log(`NoScript XSS filter sanitizing suspicious window.name "%s" on %s`, name, document.URL);
26
- window.name = window.name.substring(0, window.name.length - name.length);
+ let dangerousRx = /[<"'\`(=:]/g;
+ if (/[<"'\`(=:]/.test(window.name)) {
+ console.log(`NoScript XSS filter sanitizing suspicious window.name "%s" on %s`, window.name, document.URL);
+ window.name = window.name.replace(dangerousRx, '');
27
}
28
29
});
0 commit comments