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

uBo lite detected on megaup.net #15

Closed
6 tasks done
lazymonkey2 opened this issue Nov 29, 2022 · 8 comments
Closed
6 tasks done

uBo lite detected on megaup.net #15

lazymonkey2 opened this issue Nov 29, 2022 · 8 comments

Comments

@lazymonkey2
Copy link

lazymonkey2 commented Nov 29, 2022

Prerequisites

I tried to reproduce the issue when...

  • uBO is the only extension
  • uBO with default lists/settings
  • using a new, unmodified browser profile

URL(s) where the issue occurs

https://megaup.net/1aknk/sc23898-TSOMISE.rar

Describe the issue

uBlock is detected when loading megaup.net pages with optimal or complete settings.
when using basic setting uBlock is not detected and some ads are blocked, but I still see many ads that are not blocked.

Screenshot(s)

basic is not detected but many ads are not blocked
image

optimal and complete is detected:
image

uBlock Origin version

uBlock Origin Lite 0.1.22.11165

Browser name and version

Edge Version 107.0.1418.62 (Official build) (64-bit)

Settings

image

Notes

No response

@mapx- mapx- transferred this issue from uBlockOrigin/uAssets Nov 29, 2022
@gorhill
Copy link
Member

gorhill commented Nov 29, 2022

I see two filters enforced in uBO's logger for that site which can't be directly converted to MV3:

  • *$frame,redirect-rule=noopframe,domain=megaup.net
  • /^https?:\/\/(?:[a-z]{2}\.)?[0-9a-z]{7,16}\.com\/[a-z](?=[a-z]{0,25}[0-9A-Z])[0-9a-zA-Z]{3,26}\/(?:[1-5]\d{4}|[3-9]\d{3})\??(?:_=\d+|v=\d)?$/$script,redirect-rule=noop.js

First one might be converted to a redirect rule, but second one is not convertible because the regex is not supported in MV3.

Solution is to use uBO, I can't make the regex work in uBOL, it's an MV3 API limitation.

@dotproto
Copy link

Thanks for creating the mv3 hardship label, @gorhill. I'm hoping this label will help inform discussions at the WECG and in Chrome.

AFAIK the regular expression doesn't work in MV3 because Chrome uses RE2 for dNR regular expression matching and RE2 doesn't support lookarounds. I think that if (?=[a-z]{0,25}[0-9A-Z]) were dropped from the rule it could be used in uBOL. Unfortunately, in my testing I didn't see any requests that matched the original RegExp, so I'm not confident that removing the lookahead won't have unintended side effects.

@gorhill
Copy link
Member

gorhill commented Nov 30, 2022

I think that if (?=[a-z]{0,25}[0-9A-Z]) were dropped from the rule it could be used in uBOL.

That part is important as it prevent false positives, and also it's not so sure it would still work in uBOL, consider these regexes which are currently rejected by DNR:

  • /(https?:\/\/)104\\.154\..{100,}/
  • /\/[0-9a-z]{8,10}\?shu=[0-9a-z]{150,}/

It's just a sample, I currently see 39 regexes (out of 136 total) with no lookaround part in default filterset which are refused by the DNR API because of memoryLimitExceeded reason.

@dotproto
Copy link

Thanks for the clarification. The memory limit for compiled RE2 expressions slipped my mind. I feel like it should be possible to rewrite that expression to avoid lookarounds (and am trying hard not nerdsnipe myself with this), the compiled expression may be too large for dNR's current limits.

@gorhill, if it's not too much trouble, would it be possible to get a gist/paste/whatever with those 39 rules? I think dNR rules would be best, but even just the list of RegExps would be quite helpful.

@mapx-
Copy link

mapx- commented Nov 30, 2022

@dotproto you can take a look here:

https://github.com/gorhill/uBlock/blob/master/dist/mv3/log.txt

searching for RE2-compatible

and as I posted on slack the issues list here:
uBlockOrigin/uBlock-issues#338 (comment)

@gorhill
Copy link
Member

gorhill commented Nov 30, 2022

The rejected regexes are reported at the dev tools console of uBO Lite when installing or reloading the extension. I am not at the desktop computer at the moment.


@dotproto Here are the regexes currently rejected by the DNR engine at runtime -- none of these have lookaround part since such regex filters are discarded at compile time:

(https?:\/\/)104\.154\..{100,}
(https?:\/\/)104\.197\..{100,}
(https?:\/\/)104\.198\..{100,}
(https?:\/\/)130\.211\..{100,}
(https?:\/\/)142\.91\.159\..{100,}
(https?:\/\/)213\.32\.115\..{100,}
(https?:\/\/)216\.21\..{100,}
(https?:\/\/)217\.182\.11\..{100,}
(https?:\/\/)51\.195\.31\..{100,}
^https?:\/\/.*\.(club|news|live|online|store|tech|…pace|network|live|work|systems|ml|world|life)\/.*
^https?:\/\/.*\/[a-z0-9A-Z_]{2,15}\.(php|jx|jsx|1ph|jsf|jz|jsm|j$)
^https:\/\/[a-z]{2,14}\.wp\.pl\/[a-zA-Z0-9_-]{200,915}$
^https?:\/\/www\.myservices\.equifax\.ca\/TSPD\/[0-9a-f]{30,}
\/[0-9a-z]{8,10}\?shu=[0-9a-z]{150,}
\/(?:[0-9a-z]{7,25}-){9,13}[0-9a-z]{10,15}\/(?:[0-9a-z]+\/)+index\.php
^https:\/\/[0-9a-z]{3,}\.[-a-z]{10,}\.(?:li[fv]e|top|xyz)\/[a-z]{8}\/\?utm_campaign=\w{40,}
\/[A-Z]\/[-0-9a-z]{5,}\.com\/(?:[0-9a-f]{2}\/){3}[0-9a-f]{32}\.js$
\.com\/[-_0-9a-zA-Z]{4,}\/[-\/_0-9a-zA-Z]{25,}$
^https?:\/\/.*\/sw\.js\?[a-zA-Z0-9%]{50,}
^https?:\/\/.*\.(club|bid|biz|xyz|site|pro|info|on…|space|network|live|systems|ml|world|life|co)\/.*
^https?:\/\/.*(com|net|top|xyz)\/(bundle|warning|s…vicon|star|header)\.(png|css)\?[A-Za-z0-9]{30,}.*
^https?:\/\/[a-z]{8,15}\.top\/[-a-z]{4,}\.css\?aHR0c[\/0-9a-zA-Z]{33,}=?=?$
^https?:\/\/[a-z]{8,15}\.xyz\/[-a-z]{4,}\.css\?aHR0c[\/0-9a-zA-Z]{33,}=?=?$
^https?:\/\/[a-z]{8,15}\.top\/[a-z]{4,}\.png\?aHR0c[\/0-9a-zA-Z]{33,}=?=?$
^https?:\/\/[a-z]{8,15}\.xyz\/[a-z]{4,}\.png\?aHR0c[\/0-9a-zA-Z]{33,}=?=?$
^https?:\/\/(?:www\.|[0-9a-z]{7,10}\.)?[-0-9a-z]{5,}\.com\/(?:[0-9a-f]{2}\/){2,3}[0-9a-f]{32}\.js
^https:\/\/[0-9a-f]{10}\.[0-9a-f]{10}\.com\/[0-9a-f]{32}\.js$
^https?:\/\/[-a-z]{6,16}\.com?\/[a-d][-\.\/_A-Za-z…_0-9a-zA-Z][-\.\/_A-Za-z][-\/_0-9a-zA-Z]{22,162}$
^https?:\/\/[-a-z]{6,16}\.info\/[a-d][-\.\/_A-Za-z…_0-9a-zA-Z][-\.\/_A-Za-z][-\/_0-9a-zA-Z]{22,162}$
^https?:\/\/[-a-z]{6,16}\.pro\/[a-d][-\.\/_A-Za-z]…_0-9a-zA-Z][-\.\/_A-Za-z][-\/_0-9a-zA-Z]{22,162}$
^https?:\/\/[-a-z]{6,16}\.xyz\/[a-d][-\.\/_A-Za-z]…_0-9a-zA-Z][-\.\/_A-Za-z][-\/_0-9a-zA-Z]{22,162}$
^https:\/\/cdn\.jsdelivr\.net\/npm\/[-a-z_]{4,22}@latest\/dist\/script\.min\.js$
(https?:\/\/)\w{30,}\.me\/\w{30,}\.
^https?:\/\/s3\.*.*\.amazonaws\.com\/[a-f0-9]{45,}\/[a-f,0-9]{8,10}$
^https?:\/\/[0-9a-f]{50,}\.s3\.amazonaws\.com\/[0-9a-f]{10}$
^https?:\/\/s3\.us-east-1\.amazonaws\.com\/[0-9a-f]{50,}\/[0-9a-f]{10}$
^https?:\/\/[a-z]{8,15}\.top(\/(?:\d{1,5}|0NaN|art…|pages?|static|view|web|wiki)){1,4}(?:\.html|\/)$
^https?:\/\/[a-z]{8,15}\.xyz(\/(?:\d{1,5}|0NaN|art…|pages?|static|view|web|wiki)){1,4}(?:\.html|\/)$
^https?:\/\/[-0-9a-z]{5,}\.com\/[0-9a-z]{8,10}\?key=[0-9a-f]{32}$

@Yuki2718
Copy link

The rejected regexes are reported at the dev tools console of uBO Lite when installing or reloading the extension.

Sorry, how can I see this? I don't see anything on Console of background or dashbord when I refresh the page or disable-enable uBOL.

@gorhill
Copy link
Member

gorhill commented Jun 29, 2024

You need to install uBOL as a local package. Download from releases. For chromium, unzip then load with "Load unpacked". For Firefox go to about:debugging#/runtime/this-firefox, then "Load As Temporary Add-on..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants