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

reduce the scope of the fuzzer #846

Merged
merged 2 commits into from
Jan 22, 2025

Conversation

lemire
Copy link
Member

@lemire lemire commented Jan 22, 2025

I am concerned that the fuzzer is a bit too crazy.

@lemire lemire requested a review from anonrig January 22, 2025 20:19
Copy link
Member

@anonrig anonrig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with landing this as is, but I think what the fuzzer is doing is correct. When inputs are getting larger and larger std::regex compile time doesn't increase linearly depending on the input size.

We can have std_regex_provider as the default regex but it's not recommended to be used in production systems at all, due to the possibility of having a DDoS using an unsafe input.

I recommend adding re2 as a dependency (which is enabled by a flag) and for others (such as nodejs and cloudflare workers) it is required to pass a custom regex_provider so we know that we don't actually have a path that can halt a system based on the input.

@anonrig anonrig merged commit 6f14ce9 into make-regexp-pluggable Jan 22, 2025
31 checks passed
@anonrig anonrig deleted the make-regexp-pluggable-limitd branch January 22, 2025 20:49
@lemire
Copy link
Member Author

lemire commented Jan 22, 2025

I recommend adding re2 as a dependency (which is enabled by a flag) and for others (such as nodejs and cloudflare workers) it is required to pass a custom regex_provider so we know that we don't actually have a path that can halt a system based on the input.

My impression is that re2 does not support the ECMAScript syntax. Rather it seems to support a subset of the Perl's syntax.

https://github.com/google/re2/blob/6dcd83d60f7944926bfd308cc13979fc53dd69ca/doc/syntax.txt#L8

anonrig pushed a commit that referenced this pull request Jan 22, 2025
* reduce the scope of the fuzzer

* lint
@anonrig
Copy link
Member

anonrig commented Jan 23, 2025

@lemire You are right. Then I propose keeping regex_provider but instead of making it OPT-OUT, let's make it OPT-IN with "ADA_ENABLE_URL_PATTERN=ON" and "ADA_ENABLE_STD_REGEX_PROVIDER=ON". By default we can make it disabled so anyone needs to specificy a provider rather than using the default value. This will discourage people to use std_regex_provider and taking the risk with it.

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

Successfully merging this pull request may close these issues.

2 participants