Skip to content

Fix ReDoS#1980

Merged
aearly merged 2 commits intocaolan:masterfrom
kevinbackhouse:fix-redos
Aug 8, 2024
Merged

Fix ReDoS#1980
aearly merged 2 commits intocaolan:masterfrom
kevinbackhouse:fix-redos

Conversation

@kevinbackhouse
Copy link
Copy Markdown
Contributor

This fixes the ReDoS issue that was reported in #1975.

I couldn't find a way to fix the ReDoS without making minor changes to the behavior of the regex, so I've split this PR into two commits to show what I've done. The first commit simplifies the regex, but in a way that will make it match a superset of the strings that it matched before. The second commit fixes the ReDoS (in both regexes) without changing their behavior.

The new version isn't exactly equivalent to the old: it matches a
superset of the strings matched by the old version.
@aearly aearly merged commit 5f756b4 into caolan:master Aug 8, 2024
@aearly
Copy link
Copy Markdown
Collaborator

aearly commented Aug 8, 2024

Thanks for fixing this. The slightly expanded regex is totally fine. Hopefully this keeps the CVE hunters with regex scanners at bay.

@wangweiu
Copy link
Copy Markdown

hi @aearly , Is this fix for the CVE-2024-39249? When will a new version be ready? Thanks.

@zteric
Copy link
Copy Markdown

zteric commented Aug 19, 2024

Hi @aearly , can we expect a quick release for this fix?

@kevinbackhouse kevinbackhouse deleted the fix-redos branch August 19, 2024 16:48
@aearly
Copy link
Copy Markdown
Collaborator

aearly commented Aug 19, 2024

Published in 3.2.6. Also note that this was an invalid, disputed CVE.

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.

4 participants