Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only apply generic $removeparam rules to document/subdocument/xhr requests by default #38753

Closed
ghost opened this issue Jun 1, 2024 · 3 comments · Fixed by brave/brave-core#24206
Assignees
Labels
bug feature/shields/adblock Blocking ads & trackers with Shields OS/Android Fixes related to Android browser functionality OS/Desktop QA/No release-notes/include

Comments

@ghost
Copy link

ghost commented Jun 1, 2024

Description

Recently I noticed how I couldn't play a tiktok video on the browser, and filtering out it's because I have https://raw.githubusercontent.com/AdguardTeam/FiltersRegistry/master/filters/filter_17_TrackParam/filter.txt and that list has the $removeparam=btag generic remove param.

and that is being applied to the Media in tiktok, not just the document.

if you use $document,removeparam=btag Tiktok will work because it will filter the removeparam to just the document and if you use $media,removeparam=btag the issue will re-appear, because media is now the target.

This seems something interesting going on in Brave because other adblockers don't seem to be doing that removing of parameters in media or other elements.

Can people get tracked by parameters on other than documents? probably, so the problem is not that the removeparam is being applied to media, but that a generic one which is pretty common in lists is not applied to the document only, because that would be the best usage case for that one and how it is done by external lists like Adguard filter_17_TrackParam one.

Anyway, if you go to https://www.tiktok.com/@shellie468/video/7308173621657193770 the video will not play, and if you go to devtools it will say (canceled) as the reason for not working, and on Android it will just say the video is not available right away.

You can see here the normal URL:
https://v16-webapp-prime.tiktok.com/video/tos/maliva/tos-maliva-ve-0068c799-us/o0pDiVDXFKkga2rjcRFeABlE43AIESQfgl9ODE/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&dr=0&lr=unwatermarked&cd=0%7C0%7C0%7C&cv=1&br=2634&bt=1317&cs=0&ds=6&ft=4fUEKMMh8Zmo0U.3J-4jV.CgZpWrKsd.&mime_type=video_mp4&qs=0&rc=aWVoOzY4M2Q8ZDQ5M2lkaEBpM2w0NHU5cjt3bzMzZzczNEBhY2IyLTUwXl8xLTAtLV41YSNjMmxyMmQ0ZWlgLS1kMS9zcw%3D%3D&btag=e00090000&expire=1717229326&l=20240601020740A4BDF53D0897721918A7&ply_type=2&policy=2&signature=537033f2dbd01950a9d89397dce22dff&tk=tt_chain_token

and you can see the &btag=e00090000 being removed here.

https://v16-webapp-prime.tiktok.com/video/tos/maliva/tos-maliva-ve-0068c799-us/o0pDiVDXFKkga2rjcRFeABlE43AIESQfgl9ODE/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&dr=0&lr=unwatermarked&cd=0%7C0%7C0%7C&cv=1&br=2634&bt=1317&cs=0&ds=6&ft=4fUEKMMh8Zmo0bi3J-4jV~bhJpWrKsd.&mime_type=video_mp4&qs=0&rc=aWVoOzY4M2Q8ZDQ5M2lkaEBpM2w0NHU5cjt3bzMzZzczNEBhY2IyLTUwXl8xLTAtLV41YSNjMmxyMmQ0ZWlgLS1kMS9zcw%3D%3D&btag=e00090000&expire=1717229250&l=202406010206245D8FD57D0A4109192678&ply_type=2&policy=2&signature=c79dab648b138181d2e1bcbfda8d3863&tk=tt_chain_token

I didn't have this issue before, so I wonder if it is a regression because I doubt, this was a previous behavior with generic removeparam rules, because I doubt tiktok just started adding those parameters to their videos.

Steps to reproduce

  1. add $removeparam=btag
  2. go to https://www.tiktok.com/@shellie468/video/7308173621657193770
  3. you will not be able to play the video
  4. on mobile it will say video not available (besides the issues of redirection and not playing the video because it wants you to use the app, but at least it loads the video)

Actual result

Generic $removeparam is being applied to more than just the document

Expected result

Generic $removeparam should only apply to documents unless specified by the rule.

Reproduces how often

Easily reproduced

Desktop Brave version (brave://version info)

1.68.61 Chromium: 126.0.6478.26 (Official Build) nightly (64-bit)
Windows 11 Version 23H2 (Build 22631.3672)

Android device

  • Brand/model: Samsung
  • Android version: 14
@ghost ghost added OS/Android Fixes related to Android browser functionality OS/Desktop labels Jun 1, 2024
@diracdeltas
Copy link
Member

cc @antonok-edm @fmarier

@antonok-edm antonok-edm self-assigned this Jun 4, 2024
@antonok-edm antonok-edm added bug feature/shields/adblock Blocking ads & trackers with Shields labels Jun 5, 2024
@antonok-edm
Copy link
Collaborator

We have this logic in adblock-rust.

Looks like uBlock Origin defaults to document, subdocument, and XHR requests.

I can change that in adblock-rust - should be easy enough to fix. Thanks for reporting!

@antonok-edm
Copy link
Collaborator

Will be fixed by updating adblock-rust to v0.8.11.

@brave-builds brave-builds added this to the 1.69.x - Nightly milestone Jun 17, 2024
@antonok-edm antonok-edm changed the title Generic $removeparam being applied to more than just the document Only apply generic $removeparam rules to document/subdocument/xhr requests by default Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug feature/shields/adblock Blocking ads & trackers with Shields OS/Android Fixes related to Android browser functionality OS/Desktop QA/No release-notes/include
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants