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

HOSTS file filtering also blocking subdomains #1003

Closed
5 of 8 tasks
kulfoon opened this issue Apr 29, 2020 · 4 comments
Closed
5 of 8 tasks

HOSTS file filtering also blocking subdomains #1003

kulfoon opened this issue Apr 29, 2020 · 4 comments
Labels
invalid not a uBlock issue

Comments

@kulfoon
Copy link

kulfoon commented Apr 29, 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

Similiar to: gorhill/uBlock#1468

A bug or a feature...I hope I won't become fooled (aka rick'rolled / rickrolling) again by uBO's feature or description of hosts file in uBO , but most likely it's a bug, as there was already a similar bug that was reported and repaired: gorhill/uBlock#1468. As far I know hosts file entries should not block neither ccTLD nor subdomains as well. I checked it myself by adding 127.0.0.1 wp.pl to my Windows's hosts file, restarted browser, and couldn't visit wp.pl while I still could visit poczta.wp.pl, also see here. Apart from subdomains being blocked itself, blocked subdomains may lead to higher level domains breakages as well. I have a small army of $badfilter lines in uBO to unbreak all websites broken by hosts lists I use in uBO, wonder how many of websites are broken/inaccessible due to the bug, and not due to hosts lists's false hits. Also from uBO's wiki: " the interpretation must be "block network requests to the site example.com" " - so xxx.example.com site should not be blocked.

A specific URL where the issue occurs

Example: https://poczta.wp.pl/

Steps to Reproduce

1 Add example rule wp.pl or 127.0.0.1 wp.pl to uBO's My filters pane and save it
2 Visit wp.pl (can not visit) and then poczta.wp.pl (can not visit)
3 uBO saying poczta.wp.pl is blocked by ||wp.pl^

Expected behavior:

The example rule wp.pl or 127.0.0.1 wp.pl should not block subdomains

Actual behavior:

The example rule wp.pl or 127.0.0.1 wp.pl blocks subdomains

Your environment

  • uBlock Origin version: 1.26.3b13
  • Browser Name and version: Firefox 75 64bit / Opera 68 64bit
  • Operating System and version: Windows 7 SP1 64bit
@gorhill
Copy link
Member

gorhill commented Apr 29, 2020

By design, uBO can load the hosts file and create filters from it, but as opposed to how the OS handles hosts files, uBO propagates the block rule to subdomains.

@uBlock-user uBlock-user added the invalid not a uBlock issue label Apr 29, 2020
@kulfoon
Copy link
Author

kulfoon commented Apr 29, 2020

Oh, omg, lol, so I've been fooled / confused / rick'rooled again, like here, also I have been fooled here as well, so I got rick-rooled already 3 times in a few days, by various descriptions, it's so funny.

The uBO's wiki about the hosts feature lacks information about such feature being an intended, different than real hosts, behaviour, what may be confusing / misleading that there is a bug in uBO... perhaps such info about that it's intended behaviour, does exist somewhere deep in some uBO's release / commit description or somewhere else, I wonder how much and deep one must read and investigate to get real and proper info about some feature, this is just funny.

Btw. may I ask why uBO propagates the block rule to subdomains? As uBO changes default hosts file behaviour it may lead to websites inaccessibility / breakages, not intended by the real hosts filter lists. Alternativiely if that's already answered somewhere in release/commit desciption then I'll not bother you anymore and will try to find the proper info myself.

@gorhill
Copy link
Member

gorhill commented Apr 29, 2020

The documentation was updated to make this clear.

may I ask why uBO propagates the block rule to subdomains

That's the way I decided it would work 6-7 years ago.

@kulfoon
Copy link
Author

kulfoon commented Apr 29, 2020

That's the way I decided it would work 6-7 years ago.

So old ago, that despite looking deeply, there is nothing in both old uBO repo nor in the current uBO repo about uBO's HOSTS support implementation, neither in ISSUES's titles, nor in RELEASES's descriptions nor in COMMITS's descriptions, the only info is in the current repo's WIKI.

The documentation was updated to make this clear.

It's much better, but it still may be confusing / rickrolling, coz there is not clearly mentioned about difference between uBO's HOSTS syntax and the real HOSTS file syntax, one must still know the both and then deduce/notice the difference himself, and:

  1. if the one doesn't know the real HOSTS file syntax, might end up thinking the both implementations are equal
  2. and even if the one knows the real HOSTS file syntax, still might simply overlook the difference, and still end up thinking the both implementations are equal
  3. and if the one will notice the difference, still might end up thinking it's a bug and not an intended implementation difference, unless he notice and read the current thread on the issue tracker

Hence, it would be good to add another sentence like:

Also, this creates another ambiguity with HOSTS file syntax as well, which given a host example.com, will block example.com only, unlike uBO's implementation, which will block example.com and all it's subdomains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid not a uBlock issue
Projects
None yet
Development

No branches or pull requests

3 participants