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

Do not triggers strict blocking for wildcard-only patterns #1147

Closed
7 of 8 tasks
Yuki2718 opened this issue Jul 11, 2020 · 8 comments
Closed
7 of 8 tasks

Do not triggers strict blocking for wildcard-only patterns #1147

Yuki2718 opened this issue Jul 11, 2020 · 8 comments
Labels
bug Something isn't working fixed issue has been addressed

Comments

@Yuki2718
Copy link

Yuki2718 commented Jul 11, 2020

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

I was testing rules like ||ads. used by some non-default lists and found ||ads.*^ triggers strict blocking. Then I found #687 which explains why strict blocking is triggered only for hostname rules by default. Now I tested ||*.*^ and it also does! I guess it's not an intended behavior.

strict

A specific URL where the issue occurs

Whatever, so I used https://www.shush.se/ for example.

Steps to Reproduce

  1. Add ||*.*^ or .*^ to My filters
  2. Visit any sites

Expected behavior:

Too generic rules like this doesn't trigger strict blocking unless $document or $all is added.

Actual behavior:

Described

Your environment

  • uBlock Origin version: 1.28.0
  • Browser Name and version: Firefox 78.0.2
  • Operating System and version: Windows 10
@gwarser gwarser added the something to address something to address label Jul 11, 2020
@gwarser
Copy link

gwarser commented Jul 11, 2020

I think this ||ads.*^ is good, ||*.*^ is acceptable, but .*^ rather not.

@gorhill
Copy link
Member

gorhill commented Jul 11, 2020

.*^ is equivalent to .. Should we really care about such filter? I don't see this sort of filter ever happening in the real world.

@Yuki2718
Copy link
Author

I don't see this sort of filter ever happening in the real world.

Neither do I, probably it doesn't need to be addressed or should be given the least priority. Just wanted to brought your attention as per #687.

@gwarser gwarser added wontfix won't be addressed and removed something to address something to address labels Jul 11, 2020
@gwarser gwarser closed this as completed Jul 11, 2020
@gorhill
Copy link
Member

gorhill commented Jul 11, 2020

Well @Yuki2718 has a point, since I did something to prevent strict blocking for |*|, I logically should do the same for .*^. I will first look whether it's a trivial fix, and if not then I doubt I will ever take the time to fix it.

@gorhill gorhill reopened this Jul 11, 2020
@gorhill
Copy link
Member

gorhill commented Jul 11, 2020

The fix is trivial if uBO checks if the filter starts with ||, which is what internally happens even if the filter is example.com. However I am unable to determine if this will cause unforeseen false negatives, i.e. documents which should have been blocked but end up not being blocked.

@gwarser gwarser removed the wontfix won't be addressed label Jul 11, 2020
@uBlock-user uBlock-user added the something to address something to address label Jul 12, 2020
@Yuki2718
Copy link
Author

I am unable to determine if this will cause unforeseen false negatives, i.e. documents which should have been blocked but end up not being blocked.

You mean even if $document or $all is used? As that will be the only case strict blocking is required.

@gorhill
Copy link
Member

gorhill commented Jul 12, 2020

The heuristic-based code is not executed when document or all is used, it's executed only when these are not used, to find out whether the full document should be blocked.

Gave more thought to this and it's best that strict-block is not implicit with ||ads.*^, ||*.*^, or .*^, because all of these would match https://example.com/toto, and the purpose of the implicit strict-block heuristic is to avoid strict-blocking documents which match beyond the hostname part, while these filters are meant to block anything up to the end of the URL.

gorhill added a commit to gorhill/uBlock that referenced this issue Jul 18, 2020
@gorhill gorhill changed the title Adding caret allows whatever generic rules to be taken as a hostname and thus triggers strict blocking Do not triggers strict blocking for wildcard-only patterns Jul 19, 2020
@uBlock-user uBlock-user added bug Something isn't working fixed issue has been addressed and removed something to address something to address labels Jul 21, 2020
@Yuki2718
Copy link
Author

Yuki2718 commented Feb 24, 2022

@gorhill gorhill/uBlock@3b7a265 caused strict blocing not triggered not only by ||github. but also by ||github.*^. This might cause false negative against click-through tracker or bad sites. How about triggering strict blocking by ||github.?

Quoting the original issue comment:

I was testing rules like ||ads. used by some non-default lists and found ||ads.*^ triggers strict blocking.

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

4 participants