Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

report-uri / report-to rejector RegExp is broken #778

Closed
5 of 8 tasks
jspenguin2017 opened this issue Nov 9, 2019 · 1 comment
Closed
5 of 8 tasks

report-uri / report-to rejector RegExp is broken #778

jspenguin2017 opened this issue Nov 9, 2019 · 1 comment
Labels
bug Something isn't working fixed issue has been addressed

Comments

@jspenguin2017
Copy link

jspenguin2017 commented Nov 9, 2019

Prerequisites

  • I verified that this is not a filter issue
  • This is not a support issue or a question
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue
    • Your issue may already be reported.
  • I tried to reproduce the issue when...
    • uBlock Origin is the only extension
    • uBlock Origin with default lists/settings
    • using a new, unmodified browser profile
  • I am running the latest version of uBlock Origin
  • I checked the documentation to understand that the issue I report is not a normal behavior

Description

$csp= does not allow report-uri nor report-to, however, the RegExp rejecting these directives are broken.

A specific URL where the issue occurs

N/A

Steps to Reproduce

  1. To go My filters
  2. Add ||example.com^$csp=report-to https://other.example.com;

Expected behavior:

The filter is rejected

Actual behavior:

The filter is accepted. The current RegExp looks like this: /(?:^|;)\s*report-(?:to|uri)\b/
image

The option tested against the RegExp above is like csp=..., so the Start of line would cause it to never match when report-... directive is at the beginning.

Your environment

  • uBlock Origin version: 1.23.0
  • Browser Name and version: Chrome 80
  • Operating System and version: Windows 10
@jspenguin2017
Copy link
Author

Maybe change it to /(?:^csp=|;)\s*report-(?:to|uri)\b/?

@uBlock-user uBlock-user added Chromium specific to Chromium/Chrome something to address something to address labels Nov 9, 2019
gorhill added a commit to gorhill/uBlock that referenced this issue Nov 9, 2019
gorhill added a commit to gorhill/uBlock that referenced this issue Nov 9, 2019
Related issue:
- uBlockOrigin/uBlock-issues#778

Related commit:
- 4b34d29

Mind that `report-uri` or `report-to` could be
used somewhere in a hostname.
@uBlock-user uBlock-user added bug Something isn't working fixed issue has been addressed and removed Chromium specific to Chromium/Chrome something to address something to address labels Nov 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

2 participants