-
-
Notifications
You must be signed in to change notification settings - Fork 60
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: CVE 2023 26115 (2) #41
Conversation
Is there a reason why we can't use the built-in |
We certainly could. it would be a nice performance improvement for those running node >=10 I think using the built-in I do think it's more likely to be an improvement than a regression. I would hoever advocate for making it a different release where consumers can roll back on the |
Thanks @OlafConijn ! I'm merging and publishing this fix now. |
# [1.16.0](v1.15.0...v1.16.0) (2023-12-04) ### Upgrade * Bump word-wrap from 1.2.3 to 1.2.5 (#516) ([9c9251b](9c9251b)), closes [#516](#516) [jonschlinkert/word-wrap#24](jonschlinkert/word-wrap#24) [jonschlinkert/word-wrap#41](jonschlinkert/word-wrap#41) [jonschlinkert/word-wrap#33](jonschlinkert/word-wrap#33) [jonschlinkert/word-wrap#42](jonschlinkert/word-wrap#42) [jonschlinkert/word-wrap#24](jonschlinkert/word-wrap#24) [jonschlinkert/word-wrap#41](jonschlinkert/word-wrap#41) [jonschlinkert/word-wrap#33](jonschlinkert/word-wrap#33) [#42](#42) [#41](#41)
Fixes #32
CVE-2023-26115
TLDR; ReDoS, the issue is due to Regex matching algo.
This PR proposes an alternative solution to #33 in which:
string.prototype.trimEnd
is not used, as this would break when ran on older nodejs runtimes./\s+$/gm
).Performance:
trimEnd
is slower compared to nativestring.prototype.trimEnd
.trimEnd
function however is comparable to the original regular expression.results here