Safari's DNR fails to match trailing separator `^` in `urlFilter` to end of URL

· GitHub ·

1 min read Original article ↗

When I unzip the Safari package from https://github.com/uBlockOrigin/uBOL-home/releases/tag/uBOLite_2025.812.1339, and search for all rules with npttech.com somewhere in them, I get:

./strictblock/pgl.json:2251:   "npttech.com",
./redirect/ublock-filters.json:257:{"action":{"redirect":{"extensionPath":"/web_accessible_resources/noop.js"},"type":"redirect"},"condition":{"domains":["the-independent.com"],"resourceTypes":["xmlhttprequest"],"urlFilter":"||npttech.com/advertising.js"},"id":256,"priority":41},
./redirect/ublock-filters.json:526:{"action":{"redirect":{"extensionPath":"/web_accessible_resources/noop.js"},"type":"redirect"},"condition":{"domainType":"thirdParty","resourceTypes":["script"],"urlFilter":"||npttech.com/advertising.js^"},"id":525,"priority":11},
./main/pgl.json:2247:   "npttech.com",
./main/rus-0.json:673:{"action":{"type":"block"},"condition":{"domains":["delfi.lt"],"resourceTypes":["script"],"urlFilter":"||npttech.com/advertising.js"},"id":672,"priority":10},
./main/ublock-filters.json:380:{"action":{"type":"allow"},"condition":{"domains":["derstandard.at","derstandard.de"],"resourceTypes":["script"],"urlFilter":"||npttech.com/advertising.js"},"id":379,"priority":30},
./main/ublock-filters.json:756:{"action":{"type":"allow"},"condition":{"domains":["independent.co.uk"],"urlFilter":"||npttech.com/advertising.js"},"id":755,"priority":30},
Search completed with 7 matches.

Of these, only two rules match the current case, the others apply to specific initiators:

./redirect/ublock-filters.json:526:{"action":{"redirect":{"extensionPath":"/web_accessible_resources/noop.js"},"type":"redirect"},"condition":{"domainType":"thirdParty","resourceTypes":["script"],"urlFilter":"||npttech.com/advertising.js^"},"id":525,"priority":11},
./main/pgl.json:2247:   "npttech.com",

The one in PGL has a priority of 10, so the redirect rule with priority 11 should be picked by the DNR engine. So far looks like this might be a bug in Safari's DNR engine.


There is this WebKit bug which seems to match the issue here: https://bugs.webkit.org/show_bug.cgi?id=294132

However it's marked as fixed, but maybe the fix is not yet part of stable Safari.