You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 19, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 19, 2020. It is now read-only.
Subdomains of blocklisted domains are incorrectly displayed as explicitly blocked #284
Support issues and questions are handled at /r/uMatrix
I tried to reproduce the issue when...
uMatrix extension is wholly disabled or not installed
uMatrix is the only extension
uMatrix with default lists/settings
using a new, unmodified browser profile
I am running the latest version of uMatrix
I checked the documentation to understand that the issue I report is not a normal behavior
I used the logger to rule out that the issue is caused by my ruleset
Description
Subdomains of blocklisted domains are incorrectly displayed as explicitly blocked, rather than inherited blocked.
This does not occur in v1.4.0. git bisect blames gorhill/uMatrix@9b29230.
Pretty sure it's a side effect of now using HNTrie. Off the top of my head, this should be fixable by ensuring the hostname wholly matches here, i.e. if ubiquitousBlacklistRef.matches() returns > 0, it's an inherited block.
Checking ubiquitousBlacklistRef.matches() is 0 fixes the specfic case I wrote above, but would mean domain-in-list.test-domain.invalid is not explicitly blocked after the change (despite appearing in blocklist), as HNTrie currently includes only test-domain.invalid, not any subdomains.
blocklisted subdomains of already blocked domains are still added to the trie
I think this should be part of another issue. The fix to this is also not so trivial because this would require to also revisit the WASM code.
Also, I am also not sure this needs fixing, this can be argued that there is little to be gained to include all subdomains given that uMatrix is naturally meant to be used in a block-all/allow-exceptionally manner.
Activity
gorhill commentedon Aug 11, 2020
Pretty sure it's a side effect of now using HNTrie. Off the top of my head, this should be fixable by ensuring the hostname wholly matches here, i.e. if
ubiquitousBlacklistRef.matches()returns> 0, it's an inherited block.gorhill commentedon Aug 13, 2020
@xofe You have contributed pull requests in the past, would you be willing to fix the issue here and submit a pull request?
xofe commentedon Aug 13, 2020
Sure, I can do that.
Checking
ubiquitousBlacklistRef.matches()is 0 fixes the specfic case I wrote above, but would meandomain-in-list.test-domain.invalidis not explicitly blocked after the change (despite appearing in blocklist), as HNTrie currently includes onlytest-domain.invalid, not any subdomains.To fix this completely, I think it would require changes in HNTrie too. Namely, reverting part of gorhill/uBlock@adabb56d for uMatrix so that blocklisted subdomains of already blocked domains are still added to the trie, and removing the early exit when a domain match is found here: https://github.com/gorhill/uMatrix/blob/0bcb766/src/js/hntrie.js#L222-L224
Does this sound right to you?
gorhill commentedon Aug 13, 2020
I think this should be part of another issue. The fix to this is also not so trivial because this would require to also revisit the WASM code.
Also, I am also not sure this needs fixing, this can be argued that there is little to be gained to include all subdomains given that uMatrix is naturally meant to be used in a block-all/allow-exceptionally manner.
Only consider hostname blocklisted if it's a full match
xofe commentedon Aug 14, 2020
Fair points, I'll leave that part alone then.
I've made a pull request for this (and a few other minor fixes) at gorhill/uMatrix#1015, here's the popup after the change:
