Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix Shields not blocking WebSocket connections #26285

Closed
ghost opened this issue Oct 26, 2022 · 7 comments · Fixed by brave/brave-core#15679
Closed

Fix Shields not blocking WebSocket connections #26285

ghost opened this issue Oct 26, 2022 · 7 comments · Fixed by brave/brave-core#15679

Comments

@ghost
Copy link

ghost commented Oct 26, 2022

is it a bug or just Brave doesn't support using $websocket filter?

It is mentioned in https://github.com/brave/adblock-rust/blob/master/src/filters/network.rs, so, that's why I ask.

what about for example: $badfilter? I tested it and nothing.

That even mentions bug and tag, are they valid? do they do something or need something? because it also mentions collapse which seems to block everything when I used $collapse

This was mostly about $websocket filter but there is always questions about Brave's adblocker since it doesn't have any documentation or much explaining what is exactly supported by Brave.

@ghost ghost added the OS/Desktop label Oct 26, 2022
@ghost
Copy link
Author

ghost commented Oct 26, 2022

@pes10k I only made this account to report/ask this.
I am sure this is a bug since the network.rs talks about websockets (and badfilter which I asked as well) and there is even a mention of a rule like |ws://$domain=4shared.com being fixed/closed in Aug 12, 2020.
But it was two years ago, maybe it just got unsupported by you and there is no clear documentation or anything about it.

The problem is how Brave Team doesn't want to hear about bugs and problems, I know things can't get fixed with a magical button, but when Brave team doesn't seem to be interested to hear, it's awkward. I have reported many things and always get ignored and maybe even blocked in community brave when reporting big issues with the adblocker.

I tagged you because I don't want this issue to go to the trashcan of opened and never cared issues that are most likely bugs.

@pes10k
Copy link
Contributor

pes10k commented Oct 26, 2022

Thanks for the heads up @TheVampireInLoveWithTheCorpsesBlood. This should fix it brave/brave-core#15679 (thanks @antonok-edm !) . Should make its way into nightly in the next day or three, and we'll probably uplift to other channels soon after

@antonok-edm
Copy link
Collaborator

is it a bug or just Brave doesn't support using $websocket filter?

Thanks for reporting, this was a regression and should be fixed by brave/brave-core#15679.

what about for example: $badfilter? I tested it and nothing.

$badfilter is a bit tricky at the moment as it only works within a single adblock engine and we run multiple engines for historical reasons. That should be addressed by #5461. In the meantime it's admittedly not very useful.

That even mentions bug and tag, are they valid? do they do something or need something? because it also mentions collapse which seems to block everything when I used $collapse

$bug doesn't do anything, it's just for adding reference info. I don't think it was ever used since the original author added it; if that's the case I think we can safely remove it.

$tag will also probably be removed at some point, we've been using it for the settings in brave://settings/socialBlocking but we have some better solutions upcoming - see #26273. There hasn't ever been any user-facing way to add or toggle new tags, so consider it an internal-only feature.

$collapse to my knowledge also has never been used, and I'm not sure what the original intention of it was - we'll get that removed too.

@antonok-edm antonok-edm reopened this Oct 26, 2022
@brave-builds brave-builds added this to the 1.47.x - Nightly milestone Oct 27, 2022
@antonok-edm antonok-edm changed the title $websocket adblock rules don't work or unsupported? Fix Shields not blocking WebSocket connections Oct 27, 2022
@kjozwiak
Copy link
Member

The above requires 1.45.117 or higher for 1.45.x verification 👍

@kjozwiak
Copy link
Member

kjozwiak commented Nov 2, 2022

Verification PASSED on Win 11 x64 using the following build(s):

Brave | 1.45.118 Chromium: 107.0.5304.91 (Official Build) (64-bit)
-- | --
Revision | 3d5948960d62418160796d5831a4d2d7d6c90fa8-refs/branch-heads/5304@{#1097}
OS | Windows 11 Version 22H2 (Build 22621.755)

Reproduced the original issue using the STR/Cases outlined via brave/brave-core#15679 (comment) using 1.45.116 Chromium: 107.0.5304.91 as per the following:

Example Example
image image

Verified that Websockets appeared disabled/not working once ||websocketstest.com^$websocket is added into the custom filter area as per the following:

Example Example
image image

@stephendonner
Copy link

Verification PASSED using

Brave 1.45.118 Chromium: 107.0.5304.91 (Official Build) (x86_64)
Revision 3d5948960d62418160796d5831a4d2d7d6c90fa8-refs/branch-heads/5304@{#1097}
OS macOS Version 11.7.1 (Build 20G918)

Steps:

  1. installed 1.45.118
  2. launched Brave
  3. opened brave://settings/shields/filters
  4. added ||websocketstest.com^$websocket to the Custom filters box at the bottom
  5. clicked Save changes
  6. loaded https://websocketstest.com/

Confirmed I saw the WebSockets seem to Not Work for you :( message

brave://settings/shields/filters websocketstest.com
Screen Shot 2022-11-01 at 9 54 14 PM Screen Shot 2022-11-01 at 9 55 21 PM

@kjozwiak
Copy link
Member

kjozwiak commented Nov 2, 2022

Verification PASSED on PopOS 22.04 x64 using the following build(s):

Brave | 1.45.118 Chromium: 107.0.5304.91 (Official Build) (64-bit)
--- | ---
Revision | 3d5948960d62418160796d5831a4d2d7d6c90fa8-refs/branch-heads/5304@{#1097}
OS | Linux

Reproduced the original issue using the STR/Cases outlined via brave/brave-core#15679 (comment) using 1.45.116 Chromium: 107.0.5304.91 as per the following:

Example Example
image image

Verified that Websockets appeared disabled/not working once ||websocketstest.com^$websocket is added into the custom filter area as per the following:

Example Example
image image

# for free to join this conversation on GitHub. Already have an account? # to comment