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

ipaddress=:: unexpectedly matches IPv4-mapped IPv6 addresses #3381

Closed
9 tasks done
0f-0b opened this issue Sep 17, 2024 · 7 comments
Closed
9 tasks done

ipaddress=:: unexpectedly matches IPv4-mapped IPv6 addresses #3381

0f-0b opened this issue Sep 17, 2024 · 7 comments
Labels
bug Something isn't working fixed issue has been addressed

Comments

@0f-0b
Copy link

0f-0b commented Sep 17, 2024

Prerequisites

  • I verified that this is not a filter list issue. Report any issues with filter lists or broken website functionality in the uAssets issue tracker.
  • This is NOT a YouTube, Facebook or Twitch report. These sites MUST be reported by clicking their respective links.
  • This is not a support issue or a question. For support, questions, or help, visit /r/uBlockOrigin.
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue.
  • The issue is not present after disabling uBO in the browser.
  • I checked the documentation to understand that the issue I am reporting is not normal behavior.

I tried to reproduce the issue when...

  • uBO is the only extension.
  • uBO uses default lists and settings.
  • using a new, unmodified browser profile.

Description

The “uBlock filters – Privacy” list contains the following filter, intended to prevent access to the unspecified address ::/128.

*$all,ipaddress=::,domain=~0.0.0.0|~127.0.0.1|~[::1]|~[::]|~local|~localhost

However, IPv4-mapped addresses ::ffff:0:0/96 also happen to be blocked by this filter.

A specific URL where the issue occurs.

https://[::ffff:14cd:f3a6]/

Steps to Reproduce

  1. Enable the “uBlock filters – Privacy” list or manually add said filter.
  2. Visit https://[::ffff:14cd:f3a6]/.

Expected behavior

The page loads. The browser may warn about the certificate being invalid.

Actual behavior

The page is blocked by this extension.

uBO version

1.59.1rc1

Browser name and version

Firefox 131.0b7

Operating System and version

macOS 14.6.1

gorhill added a commit to uBlockOrigin/uAssets that referenced this issue Sep 17, 2024
@gorhill
Copy link
Member

gorhill commented Sep 17, 2024

@stephenhawk8054 The latest syntax for ipaddress= values which are not regex is "starts with", so :: ended up matching all IPv6 addresses starting with ::, which is a lot. For now I converted the value to a regex.

I chose the "starts with" approach because this makes it more convenient for IPv4 addresses, but obviously it's not working well for IPv6 addresses. We will need to agree on a syntax which is a good balance between convenience while keeping the implementation straightforward.

@stephenhawk8054
Copy link
Member

stephenhawk8054 commented Sep 17, 2024

Ah right. I forgot ipv6 has more problems with startsWith. Actually ipv4 can have issue too, 149.34.253.24 can end up matching more than expected. And might end up in using regex a lot.

Maybe a hint like

ipaddress=startsWith ::,domain=
ipaddress=startsWith 149.34.253.24,domain=

to signal using startsWith. If there's no =startsWith , match exactly?

@gorhill
Copy link
Member

gorhill commented Sep 18, 2024

I will go with wildcard at the end, i.e. ::* for anything starting with ::, and :: for exact match.

@stephenhawk8054
Copy link
Member

Wildcard is a good idea 👍

@gwarser gwarser added the bug Something isn't working label Sep 18, 2024
gorhill added a commit to gorhill/uBlock that referenced this issue Sep 18, 2024
@garry-ut99
Copy link

Small note: the above commit has been forgotten to be mentioned in release changelog

@gorhill
Copy link
Member

gorhill commented Sep 19, 2024

I don't mention commits which are not of interest to stable release. ipaddress= didn't exist in previous stable release, so a fix/change to an newly introduced option not yet in stable is of no interest. People who want to know all the details can browse all commits since last stable release.

@stephenhawk8054
Copy link
Member

Confirm it's fixed in 1.59.1rc5.

@stephenhawk8054 stephenhawk8054 added the fixed issue has been addressed label Sep 20, 2024
stephenhawk8054 added a commit to uBlockOrigin/uAssets that referenced this issue Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

5 participants