CoreLibs icon indicating copy to clipboard operation
CoreLibs copied to clipboard

Consider relaxing conditions under which $domain is interpreted as a target domain

Open hoshsadiq opened this issue 2 years ago • 1 comments

Please answer the following questions for yourself before submitting an issue.

  • [X] I am running the latest version
  • [X] I checked the documentation and found no answer
  • [X] I checked to make sure that this issue has not already been filed

AdGuard version

4.3.1

Environment

- OS: Android 14
- Device: Pixel 6 Pro
- Firmware:GrapheneOS

Root access

  • [ ] Yes, I have it.

What filters do you have enabled?

Dandelion Sprout's Annoyances List

What Stealth Mode options do you have enabled?

No response

Issue Details

Continued from https://github.com/DandelionSprout/adfilt/issues/988

Disable HTTPS filtering. Enable Dandelion Sprout's Annoyances filter Go to api.github.com or anything.github.io

Expected Behavior

api.github.com and anything.github.io should not be blocked

Actual Behavior

Both domains are blocked

Screenshots

Screenshot 1:

image

Additional Information

This blocking rule is somehow included in the annoyances list, but also it blocks a lot more than expected. E.g. it blocks all *.github.io subdomains, and api.github.com is also blocked.

From: https://github.com/DandelionSprout/adfilt/issues/988#issuecomment-1883032566

well, it's rather easy to reproduce it, just disable HTTPS filtering in AG.

The explanation is that when HTTPS filtering is disabled AG considers every connection as a document request and evaluates rules against https://domain.com/

In this particular case ~api.github.com will fix the issue.

It's hard to expect folks to whitelist every subdomain of github.io and github.com in such case. The alternatives are to either remove said filter (which I don't think is the right solution as it's a valid filter).

Is there any other solution that can be implemented here? Since this is regex filter, could the dns filter in AdGuard for Android potentially filter it as expected with the TLD? Can the filter be improved so that it is compatible with AdGuard for Android?

hoshsadiq avatar Jan 09 '24 13:01 hoshsadiq

There's some confusion about the way $document is interpreted, we could try syncing its definition with uBO / Adblock Plus: https://github.com/DandelionSprout/adfilt/issues/988#issuecomment-1883117356

ameshkov avatar Jan 09 '24 14:01 ameshkov