-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
RegExp used to detect numbers is vulnerable to ReDoS #777
Comments
Thanks for opening the issue. I've just added the regexp on #779 |
Yes, looks good to me. Thanks. |
pokoli
pushed a commit
that referenced
this issue
Apr 2, 2020
I've uploaded version 5.2.0 to npm which contains this bug fix. |
Closed
This was referenced Mar 15, 2021
This was referenced Jun 6, 2021
Closed
1 task
Closed
1 task
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Basically the title says everything.
Node code to test:
Results on my PC:
For 10000 characters:
For 100000 characters (note the exponential growth):
This comes from
var FLOAT = /^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i;
and the issue is in(\d*\.?\d+|\d+\.?\d*)
segment.One possible solution - replace current RE with something like
/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)(e[-+]?\d+)?\s*$/
. Looks ugly but it works.The text was updated successfully, but these errors were encountered: