-
Notifications
You must be signed in to change notification settings - Fork 999
suggested feature: super-linear regex detection #256
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
Comments
RegExr currently runs all matches asynchronously, and will display an error if a match takes too long. I know that's not exactly what you're suggesting, but it serves a similar purpose, and is much more straightforward for us than relying on a third party service or hosting a computationally expensive module ourselves. I'm open to a discussion of the value for this if you think I'm missing something. |
RegExr will only detect problematic regexes if long-running input is supplied. But if I am testing a super-linear regex on non-triggering input then I won't realize it. Since I think RegExr is a widely-used regex service, I think identifying super-linear regexes would be a helpful enhancement. |
Can you go into more details on this:
|
Since testing for vulnerability can be expensive, doing on-demand lookups for never-before-seen regexes could be a bottleneck and I wouldn't recommend doing so without an explicit request. That way never-before-seen regexes can be tested in the background and used the next time the regex is seen. This would be beneficial provided that RegExr is used widely enough that you see the same regex more than once -- I imagine this is the case? |
See my vuln-regex-detector project.
I also created an npm module that queries a service I'm hosting. See discussion of behavior here.
For a lighter-weight approach there's safe-regex but it misses 90% of vulnerable regexes and has about a 90% false positive rate. I'm working on improvements.
The text was updated successfully, but these errors were encountered: