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

New nonbacktracking algorithm for lookbehinds and lookarounds #199

Open
donabrams opened this issue Dec 5, 2023 · 4 comments
Open

New nonbacktracking algorithm for lookbehinds and lookarounds #199

donabrams opened this issue Dec 5, 2023 · 4 comments
Assignees

Comments

@donabrams
Copy link

donabrams commented Dec 5, 2023

I noticed a very recent paper by @Aurele-Barriere & @cpitclaudel that describes an algorithm for js regex lookbehinds and lookarounds that isn't vulnerable to ReDoS. Think it'd be worth adding to re2? I'm unemployed ATM, so this could be fun for me if it's the kind of direction you'd like to go.

@uhop
Copy link
Owner

uhop commented Dec 6, 2023

That would be very cool.

I suggest to write a minimal C/C++ implementation — we can dress it up as a Node extension later using the technique I used for node-re2, Node-API, or wasm.

Obviously, you can start with a POC written in JS, which is neat by itself.

Ultimately, if it works, it can be a sister project for node-re2.

@uhop uhop self-assigned this Dec 6, 2023
@Aurele-Barriere
Copy link

Hi,
Thanks for posting our work here!
We are currently focusing on implementing one version of that algorithm in the V8 JavaScript engine: https://bugs.chromium.org/p/v8/issues/detail?id=14435

Let us know if we can be of any assistance

@cpitclaudel
Copy link

Hey @donabrams and @uhop! As @Aurele-Barriere said, let us know if we can help — we'd love to see an implementation of our algorithms in re2 :)

@uhop
Copy link
Owner

uhop commented Dec 22, 2023

@Aurele-Barriere and @cpitclaudel: I want to clarify that I am not a maintainer of google/re2. I am a maintainer of Node bindings for that library interested in using modern fast tools, which are stable in the case of ReDOS yet mimic the standard JS regular expressions as much as possible so it can be used as a drop-in replacement.

While I can switch the underlying libraries, if you are interested in incorporating your code in google/re2, you should talk to different people. Naturally, I assume that would be some faceless shirts from some bowels of Google. :-D

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

No branches or pull requests

4 participants