-
Notifications
You must be signed in to change notification settings - Fork 18
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
Fix possible regex dos vulnerability. #8
Conversation
Your patch works as expected, here is me running the reproducer against the old and new packages
|
Hi, @patsplat. Thanks for this. I don't have write access to this repo (maybe @tj / @jonathanong / @ForbesLindesay / @yields might see fit to change that?) but @tj was kind of enough to give me access to the package on npm, so I've publish 0.0.2 with this change (and then quickly published 0.0.3 because I failed to update components.json for 0.0.2). Take a look (since the code/package is very small and easily auditable) and then, if it looks good to you, maybe close this issue? |
Oh, and if you want to audit the changes via GitHub, it's in my fork at https://github.com/Trott/trim. |
This is awesome, thanks for the quick help all! |
To clarify my previous post. I tested the new trim, it works as expected.
|
@joshbressers thanks for validating the fix. @tj Thanks for providing @Trott with npm access. @Trott Thanks for patching. Looks great! |
Fix possible regex dos vulnerability.
Reported via: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-7753
Adapted solution from: http://blog.stevenlevithan.com/archives/faster-trim-javascript