Skip to content

Commit

Permalink
Fix potential exfiltration of browsing history by a rogue list author…
Browse files Browse the repository at this point in the history
… through `csp=`

As reported internally to ubo-security by https://github.com/distinctmondaylila

One issue is a regression from the rewriting of the static filtering
parser in version 1.47.0, specifically the following commit:
8ea3b0f64c
The existing regex was no longer suitable to properly detect
some usage of `report-xxx` in the rwritten parser.

Another issue which predates 1.47.0 is that the regex used for
validation was case-sensititive, while the `report-uri` directive
can be written using uppercase letters, i.e. `Report-uri`.
  • Loading branch information
gorhill committed Feb 13, 2024
1 parent 2705059 commit db5656f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/static-filtering-parser.js
Expand Up @@ -896,7 +896,7 @@ export class AstFilterParser {
this.reResponseheaderPattern = /^\^responseheader\(.*\)$/;
this.rePatternScriptletJsonArgs = /^\{.*\}$/;
this.reGoodRegexToken = /[^\x01%0-9A-Za-z][%0-9A-Za-z]{7,}|[^\x01%0-9A-Za-z][%0-9A-Za-z]{1,6}[^\x01%0-9A-Za-z]/;
this.reBadCSP = /(?:=|;)\s*report-(?:to|uri)\b/;
this.reBadCSP = /(?:^|;)\s*report-(?:to|uri)\b/i;
this.reNoopOption = /^_+$/;
this.scriptletArgListParser = new ArgListParser(',');
}
Expand Down

4 comments on commit db5656f

@gorhill
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake, the proper GitHub link for the contributor who discovered and reported the issue through email is:
https://github.com/distinctmondaylilac

@gwarser
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gorhill the "Block CSP reports" option was preventing this?

@gorhill
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but it's not enabled by default in Chromium-based browsers.

@gorhill
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was preventing these reports

Sounds like this was actually happening -- I am not aware that this was ever the case. "would have prevented these reports" would be more accurate.

Please sign in to comment.