Skip to content

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 ariabuckles force-pushed the fix-strikethrough-vuln branch from 7d9a3cc to 1c9f675 Compare January 8, 2021 03:15
@ariabuckles ariabuckles merged commit f5bfed6 into master Jan 8, 2021
@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

2 participants