-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
nested lists Maximum call stack size exceeded
#1471
Comments
commonmark.js has a similar issue commonmark/commonmark.js#160 |
A more straightforward way to get a recursion error with nested lists is |
@andersk good call, looks like the DoS is in the number of characters. but we still have an issue with I'm not sure this one will be as easy to fix as blockquote since nested lists are not always the only thing in the list item. We might just have to limit the number of nested lists. |
Maximum call stack size exceeded
Looks like the list regex needs to be fixed or replaced with javascript. |
In this case, it isn't a problem with a regex. It is a problem with using recursion in the lexer. The solution would be to use regex and loop like in the block quote fix. For now I think this is a case where failing is fine because it doesn't cause a redos attack and it is very unlikely someone would legitimately have 5000 nested lists. |
I found another security issue trying to get nested lists to fail with a recursion error similar to #1462
300 iterations takes about 3 seconds
600 iterations takes about 40 seconds
The text was updated successfully, but these errors were encountered: