uBlockOrigin / uAssets

Resources for uBlock Origin, uMatrix: static filter lists, ready-to-use rulesets, etc.
GNU General Public License v3.0
4.19k stars 773 forks source link

haloged-studio.top: breakage #24298

Closed haloged closed 4 months ago

haloged commented 4 months ago

Prerequisites

URL address of the web page

https://www.haloged-studio.top/

Category

breakage

Description

UBlockOrigin unexpectedly blocked cdn.staticfiles.org, a website that provides JavaScript and CSS storage. Without it, my website would not work.

Other extensions used

No.

Screenshot(s)

Screenshot(s)

Configuration

```yaml uBlock Origin: 1.57.2 Chromium: 126 filterset (summary): network: 153814 cosmetic: 57871 scriptlet: 21642 html: 0 listset (total-discarded, last-updated): added: https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjxlist.txt: 515-3, now default: user-filters: 1-0, never CHN-0: 26435-146, now easylist: 87471-822, 34m Δ easyprivacy: 51103-2, 34m Δ plowe-0: 3543-615, now ublock-badware: 9011-0, 34m Δ ublock-filters: 38896-294, 34m Δ ublock-privacy: 938-3, 34m Δ ublock-quick-fixes: 108-0, 34m Δ ublock-unbreak: 2364-19, 34m Δ urlhaus-1: 15005-0, now filterset (user): [array of 1 redacted] trustedset: added: [array of 21 redacted] switchRuleset: added: [array of 1 redacted] userSettings: [none] hiddenSettings: [none] supportStats: allReadyAfter: 404 ms (selfie) maxAssetCacheWait: 156 ms cacheBackend: indexedDB popupPanel: blocked: 3 network: staticfile.org: 3 ```
stephenhawk8054 commented 4 months ago

staticfile.org is managed by polyfill, who was found distributing malwares through their domains:

Please update your website's code and don't use these domains any more.

famousprince commented 4 months ago

Replace the cdn.staticfiles.org with cdnjs.cloudflare.com/ajax/libs and stay away from staticfile.org.

PaTTeeL commented 2 months ago

Replace the cdn.staticfiles.org with cdnjs.cloudflare.com/ajax/libs and stay away from staticfile.org.

How can I replace it by using static filter? I've tried *$script,stylesheet,replace=/cdn.staticfile.(net|org)/cdnjs.cloudflare.com\/ajax\/libs/i in "My filters" with "Allow custom filters requiring trust" turned on, and it seems does not work.

stephenhawk8054 commented 2 months ago

replace is for replacing the content of the connection, not redirecting connections go other sources. You'll need other tools for redirection.

PaTTeeL commented 1 month ago

replace is for replacing the content of the connection, not redirecting connections go other sources. You'll need other tools for redirection.

I've already redirect connections by using Header Editor extension in Microsoft Edge :

Rules:
    "name": "Fix Supply Chain Attack",
    "ruleType": "redirect",
    "matchType": "regexp",
    "pattern": "https?:\\/\\/cdn.(?:bootcdn.net\\/ajax\\/libs|bootcss.com|polyfill.io|staticfile.(net|org))\\/(.*)",
    "to": "https://cdnjs.cloudflare.com/ajax/libs/$2"

but the web page https://www.cainiaojc.com/tool/node/ still seem's buggy, and in view-source:https://www.cainiaojc.com/tool/node/, there's several cdn.staticfile.org in html body seems cannot redirect by Header Editor.

Details ```html   | -- | --   |   |     |     |     |   |   | Node.js在线运行,代码编译测试 - 在线编译器(cainiaojc.com)   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |     |   |     |   |   |   |
  |     |   |     |     |
  |     |
  |     |
  |
  |
  |
  |
  |   |   |
  |
  |   |   |
  |
  |
  |
  |
  |   |
  |     |
  |     |
  |     |
  |
  |
  |
  |
  |     |
  |
  |
  |     |
  |
  | Node.js网页版在线编译器,是一款可在线编程编辑器,在编辑器上输入Node.js代码,点击运行,可在线编译运行Node.js,Node.js代码在线运行调试,Node.js在线编译,可快速在线测试您的Node.js代码,在线编译Node.js代码发现是否存在错误,如果代码测试通过,将会输出编译后的结果。   |
  |
  |     |
  |
  |
  |     |
  |
  |
  |     |     |
  |
  |
  |   |   |   |   |   |     | ```

I've tried

*$replace=/"https?:\/\/cdn.(?:bootcdn.net\/ajax\/libs|bootcss.com|polyfill.io|staticfile.(net|org))\/(.*)"/"https://cdnjs.cloudflare.com/ajax/libs/\$2"/i

*$document,replace=/"https?:\/\/cdn.(?:bootcdn.net\/ajax\/libs|bootcss.com|polyfill.io|staticfile.(net|org))\/(.*)"/"https://cdnjs.cloudflare.com/ajax/libs/\$2"/i

*$script,stylesheet,replace=/https?:\/\/cdn.(?:bootcdn.net\/ajax\/libs|bootcss.com|polyfill.io|staticfile.(net|org))\/(.*)/https:\/\/cdnjs.cloudflare.com\/ajax\/libs\//i

which all fails. When I added @@||staticfile.org^ in static filter, uBlockOrigin recorder shows that half of the links named staticfile.net has changed into 'cdnjs.cloudflare.com/ajax/libs/*', but all staticfile.org still there. So how should I do next then ?

stephenhawk8054 commented 1 month ago

all staticfile.org still there

I don't understand what you mean. If you mean you see the staticfile.org appearing in the logger, it's normal because each extension sees the same connections before they are redirected. Each extension cannot know what other extensions are doing with those connections.

The best way to check is using browser's network devtools and check which connections are being loaded / blocked for the websites.