Closed Bug 1590922 Opened 6 years ago Closed 6 years ago

nsContentUtils::IsURIInList improperly handles multiple records from the same origin

Categories

(Core :: Privacy: Anti-Tracking, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: englehardt, Assigned: ehsan.akhgari)

References

Details

Attachments

(2 files)

nsContentUtils::IsURIInList is called here when checking if the a URI being classified matches the skip list. aURI is the URI to be classified and aBlackList is the skip list (a comma separated string of patterns).

If the skip list contains *.example.com, then all subdomains of example.com are unblocked, but not https://example.com itself. If we want to skip the base domain as well as all subdomains, the skip list should contain both *.example.com and example.com. However, if *.example.com appears before example.com in aBlackList, the second record will fail to apply.

To understand why, consider a two-item skip list, *.example.com,example.com, and a lookup for https://example.com/favicon.ico. The aBlackList.Find call here returns an index of 2 for the host example.com,. This is because Find matches the *.example.com skiplist record instead of example.com. As expected, example.com fails the remainder of the checks for *.example.com and returns False. If the records in the skip list are reversed (i.e., example.com,*.example.com) this works as expected since Find matches the correct rule.

Blocks: 1590293
Assignee: nobody → ehsan
Pushed by eakhgari@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9c952f1da6fa Fix parsing the blocklist in nsContentUtils::IsURIInList(); r=baku
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
Pushed by eakhgari@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c6da88b94934 follow-up: the parts that didn't land in the first landing
Regressions: 1594540
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: