brave / brave/adblock-rust

URLs with many distinct segments fail to match

Open
#183 1 comment 2 reactions 1 assignee Claimed by @antonok-edm View on GitHub
bug
Dominant language
Rust
Stars
2.8k
Forks
250
Avg merge
1d 16h
Merged PRs (30d)
6

Description

`adblock-rust` performs a rough matching step against requests by splitting the URL into tokens, hashing them, and then comparing against hashes from tokens in parsed filters.

There is an [upper limit](https://github.com/brave/adblock-rust/blob/master/src/utils.rs#L25) to the number of tokens that can be generated from a URL, after which point any additional tokens are ignored. This was likely put in place to limit the performance impact from maliciously crafted URLs.

As it turns out, this limit is insufficient for a small number of real-world requests.

See https://github.com/cliqz-oss/adblocker/pull/2125#issuecomment-896907093 for relevant test cases.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.