uBlockOrigin / uBlock-issues

This is the community-maintained issue tracker for uBlock Origin
https://github.com/gorhill/uBlock
919 stars 78 forks source link

acis scriptlet and document.documentElement #2670

Open halt76 opened 1 year ago

halt76 commented 1 year ago

Prerequisites

I tried to reproduce the issue when...

Description

The zoro.to player is broken. Also, thumbnails are no longer displayed. js(acs, document.documentElement, Break;case $.) seems to be the culprit.

URL(s) where the issue occurs.

https://zoro.to/

Screenshot(s)

No response

Notes

No response

Configuration

```yaml uBlock Origin 1.49.3rc1: since: 1h.28m Firefox: 114 filterset (summary): network: 95719 cosmetic: 49770 scriptlet: 20900 html: 1102 listset (total-discarded, last-updated): added: ublock-annoyances: 5035-4, 1h.27m default: user-filters: 1-0, never ublock-filters: 34020-165, 1h.28m ublock-badware: 7119-1, 1h.28m ublock-privacy: 422-0, 1h.27m ublock-unbreak: 2028-2, 1h.27m ublock-quick-fixes: 304-0, 1h.27m easylist: 66390-613, 1h.27m easyprivacy: 31845-634, 1h.27m urlhaus-1: 6774-1, 1h.27m plowe-0: 3735-2, 1h.27m JPN-1: 11404-11, 1h.27m filterset (user): [array of 1 redacted] userSettings: contextMenuEnabled: false showIconBadge: false hiddenSettings: [none] supportStats: allReadyAfter: 834 ms (selfie) maxAssetCacheWait: 396 ms ```
stephenhawk8054 commented 1 year ago

Does this fix it for you?

zoro.to#@#^script:has-text(break;case $.)
halt76 commented 1 year ago

yes. can you fix the default filters?

ghajini commented 1 year ago

would you try stable build of ubo?

stephenhawk8054 commented 1 year ago

Hmm... right, somehow dev build breaks the site with HTML filtering. Stable works fine. Anyone else can reproduce?

mapx- commented 1 year ago

yes, is broken in the last dev build

ghajini commented 1 year ago

@gorhill , html filtering on this site breaks site in ubo dev build 1.49.3c1

stable build of ubo works

halt76 commented 1 year ago

ah... was it ubo's problem...

gorhill commented 1 year ago

html filtering on this site breaks site in ubo dev build 1.49.3c1

Works fine for me, with that filter, thumbnails are shown and player plays fine. Actually even without that filter I don't see breakage.


Never mind, I get it, it's an exception filter, I can reproduce breakage.


b16 works fine, b19 fails.

ghajini commented 1 year ago

URL= https://zoro.to/home or any video

Filter = zoro.to##^script:has-text(break;case $.) in ublock filters

issue = thumbnails are broken, in above url ,also video doesn't start

ubo version = 1.49.3c1

firefox stable

normal stable build 1.49.2 , no breakages,

only dev build 1.49.3c1 suffers

gorhill commented 1 year ago

Can you guys confirm it works if using this exception filter?

zoro.to#@#+js(abort-current-script, document.documentElement, break;case $.)

I can systematically break/fix by toggling the filter above, so it's not directly related to HTML filtering. I think what is happening is that with the latest code, document.documentElement may not exist yet when a scriptlet execute, and that is causing an issue when trying to trap it as that filter above does.

stephenhawk8054 commented 1 year ago
zoro.to#@#+js(abort-current-script, document.documentElement, break;case $.)

Yup, it works for me

halt76 commented 1 year ago

1.49.3rc2 seems to work fine.

MasterKia commented 1 year ago

There seems to be a bug ~when using document.documentElement~.

1- Using Firefox, open the logger and go to https://isaidub3.co/ 2- See propeller requests:

isaidub3.co    ​head    ​xhr    ​https://random_domain.com/

3- Add this then visit the page again:

isaidub3.co##+js(acs, document.documentElement, break;case $., , log, 1)

4- No more propeller requests. In console, I see [uBO] matched script text + Uncaught ReferenceError: _zpzya is not defined.

5- Navigate the website (e.g. the "Download now" links)

6- There are propeller requests again. In console instead of those two logs, I only get: Uncaught (in promise) undefined

Same exact behavior with aost:

isaidub3.co##+js(aost, document.documentElement, inlineScript, log, 1)

Same behavior with AdGuard + acis + Firefox. No problem on Chromium.

gorhill commented 1 year ago

I could reproduce once, on the first try, but after this when I was ready to investigate, I can't reproduce anymore after trying over and over.

MasterKia commented 1 year ago

I can also reproduce using these:

isaidub3.co##+js(acs, document.createElement, break;case $., , log, 1)
isaidub3.co##+js(acs, document.body, break;case $., , log, 1)

So it may not be related to document.documentElement per se.

stephenhawk8054 commented 1 year ago

Currently when I open https://www.nicekkk.com/mij/korean-tv-girl (NSFW), the logger says the filter `

##+js(abort-current-script, decodeURIComponent, 'shift')

could not be found in any of the currently enabled filter lists although it's in ublock filters - ads list: https://github.com/uBlockOrigin/uBlock-issues/assets/66517106/78027186-2484-470a-9e84-e23baaad6e86

Not sure if it's related to the quotation? The filter in ublock filters - ads list is

nicekkk.com##+js(acs, decodeURIComponent, "'shift'")

Tested with dev build b23. Steps to reproduce:

  1. Force update all filter lists
  2. Open logger and access https://www.nicekkk.com/mij/korean-tv-girl
garry-ut99 commented 1 year ago

MasterKia : https://github.com/uBlockOrigin/uBlock-issues/issues/2670#issuecomment-1680950366 : There seems to be a bug MasterKia : https://github.com/uBlockOrigin/uBlock-issues/issues/2670#issuecomment-1681276648 : I can also reproduce using these:

Can't reproduce (tried many times).


stephenhawk8054 : https://github.com/uBlockOrigin/uBlock-issues/issues/2670#issuecomment-1687364959 : could not be found in any of the currently enabled filter lists

I can reproduce. Many similar "reverse-lookup fails" bugs from the past: https://github.com/uBlockOrigin/uBlock-issues/issues?q=is%3Aissue+in%3Atitle+reverse-lookup+sort%3Aupdated-desc+NOT+compressed

gorhill commented 1 year ago

I know what the issue is for the failed reverse lookup, it's the quotes around the parameter "'shift'".

stephenhawk8054 commented 1 year ago

Ah I see, so it's not related to acs issue.

gorhill commented 7 months ago

isaidub3.co is dead, I don't know what is the issue I have to investigate.

https://zoro.to/home is also dead, redirects to a copyright-related announcement.

Also, the "could not be found in any of the currently enabled filter lists" issue should be fixed in current dev cycle, https://github.com/gorhill/uBlock/commit/49dd68ef3d.

ghajini commented 7 months ago

https://github.com/uBlockOrigin/uBlock-issues/issues/2670#issuecomment-1680950366 such an issue can be reproduced at this related site also https://share.filesh.site/view-download.php?name=RFNQICgyMDIyKSBIRFJpcCA3MjBwLm1wNA==&link=aHR0cHM6Ly9jYS5vcGVuZmlsZS5vbmxpbmUvZGxvYWQvZGwucGhwP3Q9MnRMWk40Y2tTNzBKQkVMQ0FEMGxQZyZlPTE3MDY3MzI3NTkmZj1MMlpwYkdWekwxUmhiV2xzSUUxdmRtbGxjeTlVWVcxcGJDQXlNREl5SUUxdmRtbGxjeTlFVTFBZ0tESXdNaklwTDBSVFVDQW9NakF5TWlrZ1NFUlNhWEF2UkZOUUlDZ3lNREl5S1NCSVJGSnBjQ0EzTWpCd0xtMXdOQT09

STR =

gorhill commented 7 months ago

I refreshed many time (devtools not opened), and I couldn't reproduce with uBO 1.55.1b26 and Chromium 120 -- to be sure at the end I disabled the filter and refreshed to see the difference:

Logger output ![image](https://github.com/uBlockOrigin/uBlock-issues/assets/585534/b5165909-3473-4119-9f0a-410b193e7ef0)
ghajini commented 7 months ago

this is reproducible on firefox also but i can use there share.filesh.site##^script:has-text(break;case $.) to fix

MasterKia commented 6 months ago

https://github.com/uBlockOrigin/uAssets/commit/5ad471201350421460ba2ec0d27e998220e1c1da#commitcomment-138647612:

@ftc2: garagejournal.com##+js(acs, JSON.parse, AdBlock): sometimes works for me, but navigating around by clicking on links or going back/forward in history can make it appear https://www.garagejournal.com/forum/

D4niloMR commented 6 months ago

I have a site which is pretty easy to reproduce https://github.com/uBlockOrigin/uAssets/commit/61109367548699deac4fa2d864beafa903a3f9eb


I see a very consistent behaviour of not aborting when the devtools are opened.

Same with the exact filter replaced with aopr/aopw/aost.


Needs to add /console-ban.min.js in "My filters" to stop the 3p anti devtools.


STR:

  1. Add /console-ban.min.js and the three filters added here https://github.com/uBlockOrigin/uAssets/commit/61109367548699deac4fa2d864beafa903a3f9eb in "My filters"
  2. Open redecanais.zip on Firefox - without ublock annoyances.
  3. Open the devtools and press F5.
  4. Try to select or right-click something, if it worked refresh until you can't. 5/7 times at most.

Same STR with aopr/aopw/aost.

ghajini commented 5 months ago

moviesda9.co

firefox /firefox android stable ubo 1.56

add

moviesda9.co##+js(acs, Object.defineProperty, break;case $.)
moviesda9.co#@#^script:has-text(;}}};break;case $.)
moviesda9.co#@#+js(acs, Object.defineProperty, ;}}};break;case $.)

so its abort-current-inline-script issue specifically website changes frequently so its not limited to 1 website

garry-ut99 commented 5 months ago

I spent some time analysing it:

website changes frequently so its not limited to 1 website

moviesda9.co now redirects to : moviesda0.com


moviesda9.co##+js(acs, Object.defineProperty, break;case $.)

Still popups even in AdGuard for Browser with the same filter, which means the issue occurs not only in uBO: moviesda0.com#%#//scriptlet('abort-current-inline-script', 'Object.defineProperty', 'break;case $.')


This still has popups in uBO: moviesda0.com##+js(acs, Object, break;case $.) but this works: moviesda0.com##+js(acs, Object) I'm not saying to add it to filters, it's not my point here, because it's too broad, too risky and aborts too early, thus adding it doesn't have much sense, I'm just showing it as an example and discussing the current issue here, also in AdGuard for Browser, the same filter causes browser tab freeze, someone needs to investigate with profiler : moviesda0.com#%#//scriptlet('abort-current-inline-script', 'Object')


so its abort-current-inline-script issue specifically

It would indicate that it might be still this issue:

but now I'm not sure, because even with the following filters, popups still appear, which would indicate issue with so many scriptlets, which is hard to believe:

moviesda0.com##+js(aopr, Object.defineProperty)
moviesda0.com##+js(aopw, Object.defineProperty)
moviesda0.com##+js(set, Object.defineProperty, noopFunc)

Or maybe the issue is just a race condition, Or the website uses some hackery/tricks, Or the issue with both adblockers: uBO & AG