Bug 1373293 ignore and report invalid origin permissions, r?aswan
MozReview-Commit-ID: 3CYjIJCcaeh
--- a/toolkit/components/extensions/Extension.jsm
+++ b/toolkit/components/extensions/Extension.jsm
@@ -558,20 +558,25 @@ this.ExtensionData = class {
if (!acceptedExtensions.split(",").includes(this.id)) {
this.manifestError("Only whitelisted extensions are allowed to access the geckoProfiler.");
continue;
}
}
let type = classifyPermission(perm);
if (type.origin) {
- let matcher = new MatchPattern(perm, {ignorePath: true});
+ try {
+ let matcher = new MatchPattern(perm, {ignorePath: true});
- whitelist.push(matcher);
- perm = matcher.pattern;
+ whitelist.push(matcher);
+ perm = matcher.pattern;
+ } catch (e) {
+ Cu.reportError(`Invalid origin permission ignored: ${perm}`);
+ continue;
+ }
} else if (type.api) {
this.apiNames.add(type.api);
}
this.permissions.add(perm);
}
this.whiteListedHosts = new MatchPatternSet(whitelist);