-
Notifications
You must be signed in to change notification settings - Fork 7
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
catastrophic backtracking in options-list
regex
#40
Comments
This was referenced Sep 16, 2023
trond-snekvik
added a commit
that referenced
this issue
Sep 17, 2023
The options list only supported parts of the options list syntax, missing angle brackets around placeholders and several corner cases in the alias syntax. This commit fixes all known issues including #40, and adds a test case specifically for options lists.
Hey, thanks for reporting, and thanks for the fix. I can confirm that the fix does resolve the issue, but as I was writing a test case for this, I found a few other flaws in the options list regex. I made a PR to fix all issues here: #42. For reference, the options list entry covers this concept: https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#option-lists |
trond-snekvik
added a commit
that referenced
this issue
Sep 17, 2023
The options list only supported parts of the options list syntax, missing angle brackets around placeholders and several corner cases in the alias syntax. This commit fixes all known issues including #40, and adds a test case specifically for options lists.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this regex causes catastrophic backtracking leading to denial-of-service for particularly written files --
vscode-rst/syntaxes/rst.tmLanguage.json
Line 187 in 0de9133
here's a small rst example from cpython:
when attempting to match the second line the engine will recurse ~essentially forever (libonig has a boundary case to prevent this and raises an error)
I'm a little unfamiliar with what this is attempting to match -- but converting the second group to an atomic group
(?>:
seems to make the regex terminate quickly rather than spinningThe text was updated successfully, but these errors were encountered: