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

Filter syntax could potentially cause false positives #19

Closed
gorhill opened this issue Aug 13, 2017 · 2 comments

Comments

@gorhill
Copy link

commented Aug 13, 2017

In your README file, you mention that the list can be used as a block list in other blockers:

As a blacklist for another blocker

Add https://ssl.bblck.me/BarbBlock.txt as a blacklist.

Given the syntax you have used (||example.com), and the comment character used (!), I am going to assume you have in mind blockers such as ABP, uBO, AdGuard, etc.

However the syntax of the filters could lead to false positives. For instance, the first entry:

||functionalclam.com

This could cause false positives. Consider this fictitious URL:

https://functionalclam.com.example.com/index.html

Your filter would be a hit on this URL, while I am sure this is not what you intended.

You need to add the ^ special character at the end of the hostname:

||functionalclam.com^

The purpose of ^ is described here: https://adblockplus.org/filter-cheatsheet#blocking2:

A separator character has to follow that will indicate the end of the domain name, e.g. / or :.

I know a false positive is unlikely with those weird hostnames, but still, a ^ appended at the end would just completely remove the risk.

@migueldemoura

This comment has been minimized.

Copy link

commented Aug 13, 2017

Beat me to it. Absolutely correct

@paulgb

This comment has been minimized.

Copy link
Owner

commented Aug 13, 2017

Thanks, this is important to get right!

paulgb added a commit that referenced this issue Aug 14, 2017

@paulgb paulgb closed this Aug 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.