Tracking Protection stats: domain whitelist will falsely match domains (actual content blocker is ok)
Categories
(Firefox for iOS :: General, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
fxios | 16.0 | --- |
People
(Reporter: garvan, Unassigned)
Details
The whitelisting for tracking protection turns domains such as "example.com" into "*.example.com$", which would incorrectly match "badexample.com".
Updated•6 years ago
|
This comment makes a good point, https://github.com/mozilla-mobile/firefox-ios/pull/4499#discussion_r251568777,
which is that the input domains are not formatted as just <domainname>
, rather they always are *<domainname>
in the wildcard input format, which is transformed to a regex with a prefix of \.*
(period literal, repeated zero or more times).
-
The code should guard against non-wildcard domains being passed in to wildcardContentBlockerDomainToRegex()
-
Whitelisting logic looks questionable, the code should not be substring matching the whitelisted domain. The
url.baseDomain
(ETLD+1) is what is used to match against the whitelisted domains, so the whitelisted domains could just store ETLD+1, and the match could be a string equality check.
Updated•6 years ago
|
The bug is not in the content blocker, which formats whitelist domains as:
"if-domain": ["*domain"]
According to docs this is fine:
Add * in front to match domain and subdomains.
from https://developer.apple.com/documentation/safariservices/creating_a_content_blocker
The bug is only in the stats reporting, so this is a minor issue.
Updated•3 years ago
|
Description
•