[GHSA-px4h-xg32-q955] ReDoS in normalize-url#7465
Open
Wenxin-Jiang wants to merge 1 commit intoWenxin-Jiang/advisory-improvement-7465from
Open
[GHSA-px4h-xg32-q955] ReDoS in normalize-url#7465Wenxin-Jiang wants to merge 1 commit intoWenxin-Jiang/advisory-improvement-7465from
Wenxin-Jiang wants to merge 1 commit intoWenxin-Jiang/advisory-improvement-7465from
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates
Comments
Versions
4.3.0and4.4.0do not contain the vulnerable regular expression and should be classified as not affected. The correct introduced version is4.4.1.Version
4.3.0contains nonormalizeDataURLfunction and nodata:URL handling at all; the source has zero occurrences of"data". Version4.4.0introducesnormalizeDataURL, but the implementation uses^data:(.*?),(.*)$, which consists of a single lazy group followed by a greedy trailing.*and does not include the optional hash fragment group. That regex shape does not exhibit the catastrophic backtracking behavior described in the advisory.The vulnerable pattern first appears in
4.4.1, which ships^data:(.*?),(.*?)(?:#(.*))?$. That is the exact regex later fixed in4.5.1by commitb1fdb51, which replaces the broad wildcard groups with constrained character classes ([^,]*?/[^#]*?).Runtime PoC ReDoS testing matches the source analysis: exploitation fails on
4.3.0and4.4.0, and succeeds on4.4.1and later affected versions.Accordingly, the introduced version should be
4.4.1, and the affected range should be narrowed from>= 4.3.0, < 4.5.1to>= 4.4.1, < 4.5.1.