Skip to content

[GHSA-c2qf-rxjj-qqgw] semver vulnerable to Regular Expression Denial of Service#6771

Merged
advisory-database[bot] merged 1 commit intoljharb/advisory-improvement-6771from
ljharb-GHSA-c2qf-rxjj-qqgw
Feb 4, 2026
Merged

[GHSA-c2qf-rxjj-qqgw] semver vulnerable to Regular Expression Denial of Service#6771
advisory-database[bot] merged 1 commit intoljharb/advisory-improvement-6771from
ljharb-GHSA-c2qf-rxjj-qqgw

Conversation

@ljharb
Copy link

@ljharb ljharb commented Feb 4, 2026

Updates

  • Affected products

Comments
Versions 1.0.0 through 1.1.4 (all v1.x) are NOT affected by this vulnerability. These versions do not have the Range class - semver.Range is undefined in v1.x. The vulnerable code path (Range constructor with regex parsing) does not exist in v1.x. Testing confirms the PoC (new semver.Range(payload)) fails with semver.Range is not a constructor on all v1.x versions. The affected range should start at 2.0.1, which is the first version containing the vulnerable Range class.

Copilot AI review requested due to automatic review settings February 4, 2026 08:05
@github-actions github-actions bot changed the base branch from main to ljharb/advisory-improvement-6771 February 4, 2026 08:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the GHSA advisory for semver ReDoS to correct the affected version range based on the fact that semver.Range does not exist in v1.x.

Changes:

  • Adjusts the affected range start from 0 to 2.0.1 for the < 5.7.2 vulnerable line.
  • Updates the advisory modified timestamp.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 65 to 69
{
"introduced": "0"
"introduced": "2.0.1"
},
{
"fixed": "5.7.2"
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The advisory text in details still says "all other versions before 5.7.2" are vulnerable, which implies v0.x/v1.x are affected. Now that the affected range starts at 2.0.1, please update the details field to reflect the corrected affected versions so the narrative matches the structured affected.ranges data.

Copilot uses AI. Check for mistakes.
@JonathanLEvans
Copy link

Do 2.0.0-beta or 2.0.0-alpha contain the vulnerable Range?

@ljharb
Copy link
Author

ljharb commented Feb 4, 2026

https://app.unpkg.com/semver@2.0.0-alpha/files/semver.js does not have a Range class, but https://app.unpkg.com/semver@2.0.0-beta/files/semver.js#L524 does have function Range(, so just from looking at the code i'd say alpha no, beta yes. I can do a more thorough investigation though.

@JonathanLEvans
Copy link

https://app.unpkg.com/semver@2.0.0-alpha/files/semver.js#L427 seems to start the Range function for 2.0.0-alpha.

@ljharb
Copy link
Author

ljharb commented Feb 4, 2026

oh whoops, nice find. both are vulnerable, then.

@advisory-database advisory-database bot merged commit 256d1c1 into ljharb/advisory-improvement-6771 Feb 4, 2026
9 of 10 checks passed
@advisory-database
Copy link
Contributor

Hi @ljharb! Thank you so much for contributing to the GitHub Advisory Database. This database is free, open, and accessible to all, and it's people like you who make it great. Thanks for choosing to help others. We hope you send in more contributions in the future!

@advisory-database advisory-database bot deleted the ljharb-GHSA-c2qf-rxjj-qqgw branch February 4, 2026 20:39
@ljharb
Copy link
Author

ljharb commented Feb 4, 2026

@JonathanLEvans this was merged as "introduced in 2.0.1", but it seems like that should be "2.0.0-alpha" based on our discussion?

@ljharb
Copy link
Author

ljharb commented Feb 4, 2026

ah, nvm, i see GHSA-c2qf-rxjj-qqgw correctly includes the prereleases.

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.

2 participants