-
Notifications
You must be signed in to change notification settings - Fork 30.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
Quadratic regex in readline.js #26596
Comments
It is very unlikely that |
I don't think it's a massive problem if a copy-paste takes a second to parse or something |
If its just our REPL, its hard to see this as an issue. If readline is attached over TLS to a remote user, and used to implement some remote protocol, would we care then? Also, what would it take to fix this? @nodejs/security @nodejs/security-wg |
At one point, @mscdex left the following comment:
I'm not sure why it was deleted, but any use of readline outside of the REPL (or similar) could be an issue. |
To clarify, this function is only called in response to key presses.
Manually unrolling the regexp should work, I think. |
Seems like a fix was landed in e4e2b0c |
Version: master branch
Subsystem: readline
lib/readline.js
contains this code snippet:This regex is quadratic:
/(?:[^\w\s]+|\w+|)\s*$/
.I would be shocked if this were a viable ReDoS vector (hence the public bug report), but if
this.line
can be long (100K chars?) then it might present a performance problem.I have not investigated reachability/triggerability nor the use cases of readline.
The text was updated successfully, but these errors were encountered: