Skip to content
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

Strikethrough: fix exponential backtracking #95

Merged
merged 1 commit into from
Jan 8, 2021

Conversation

ariabuckles
Copy link
Owner

@ariabuckles ariabuckles commented Jan 8, 2021

A long sequence of backslashes inside a strikethrough could confuse the
strikethrough regex into exponential backtracking, causing a potential
ReDoS vulnerability.

This commit updates the strikethrough regex to only accept a backslash
if it is preceding an escaped character, as other rules handle
backslashes.

Updates to version 0.7.3 to publish this fix.

Thanks to @erik-krogh , @pwntester and the rest of the
GitHub Security Lab team
for finding this vulnerability!

Test plan:

  1. make test
    • verify the new strikethrough backtracking test passes
    • verify all the prior tests pass

A long sequence of backslashes inside a strikethrough could confuse the
strikethrough regex into exponential backtracking, causing a potential
ReDoS vulnerability.

This commit updates the strikethrough regex to only accept a backslash
if it is preceding an escaped character, as other rules handle
backslashes.

Updates to version 0.7.3 to publish this fix.

Thanks to @pwntester and the [GitHub Security Lab team](https://securitylab.github.com/)
for finding this vulnerability!

Test plan:

1. `make test`
    * verify the new strikethrough backtracking test passes
    * verify all the prior tests pass
@ariabuckles
Copy link
Owner Author

Sorry I missed your name when I first read the report, but thanks for testing and finding this @erik-krogh !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant