-
Notifications
You must be signed in to change notification settings - Fork 11
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
Regular Expression Denial of Service possible #26
Comments
i'm sort of wondering if this repo is sorta abandoned or even if it's sort of relevant? as per the description, |
I fear you're right The CVE is "applicable", as the following command does not return in a timely manner...
Replacing html-parse-stringify2/lib/parse.js Line 2 in dbf026f
/(?:<!--[\S\s]*?-->|<(?:"[^"]*"|'[^']*'|[^'">])+>)/g returns in milliseconds.
I'd offer a PR in the hope that this repo is still maintained, but I can't get the test case in HenrikJoreteg@c7274a4 to ever fail. For some reason, running under test, the RegEx fails to match much more quickly than when calling the parse code directly 😕 For now, I guess that anyone else that searches for this CVE will end up here as well |
i did the same and tests on this repo fail to match the html tag -- of course, it's not a "tag", it thinks it's valid
expects name to be i did a hot swap of this module with |
Just want to check what you mean above when you say
If I run the following snippet, it consumes a CPU at 100% and doesn't return, therefore require('html-parse-stringify2').parse("<!'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''!") |
i meant |
Ah gotcha - thanks 😃 |
|
https://snyk.io/vuln/SNYK-JS-HTMLPARSESTRINGIFY2-1079307 has been raised for a ReDoS vulnerability, along with CVE-2021-23346. The vulnerability is at
html-parse-stringify2/lib/parse.js
Line 2 in dbf026f
There is a recent fix in the original repo this was forked from. Could the same fix be applied here?
The text was updated successfully, but these errors were encountered: