Skip to content

Commit d6b6276

Browse files
committed
[XSS] More resilient name handling.
1 parent 942510f commit d6b6276

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/nscl

src/xss/XSS.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,14 @@ var XSS = (() => {
118118

119119
if (reasons.protectName) {
120120
await include("/nscl/service/ContentScriptOnce.js");
121-
await ContentScriptOnce.execute(request, {
122-
js: [{file: "/xss/sanitizeName.js"}],
123-
});
124-
if (!block) return ALLOW;
121+
try {
122+
await ContentScriptOnce.execute(request, {
123+
js: [{file: "/xss/sanitizeName.js"}],
124+
});
125+
if (!block) return ALLOW;
126+
} catch (e) {
127+
error(e, "Sanitizing name in request", request.url);
128+
}
125129
}
126130
if (reasons.urlInjection) data.push(`(URL) ${unescapedDest}`);
127131
if (reasons.postInjection) data.push(`(POST) ${reasons.postInjection}`);

0 commit comments

Comments
 (0)