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

Fix ReDoS #1980

Merged
merged 2 commits into from
Aug 8, 2024
Merged

Fix ReDoS #1980

merged 2 commits into from
Aug 8, 2024

Conversation

kevinbackhouse
Copy link
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
6 checks passed
@aearly
Copy link
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

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

@zteric
Copy link

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
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