HighGHSA-c2qf-rxjj-qqgwCVE-2022-25883
semver vulnerable to Regular Expression Denial of Service
Published 21 Jun 2023 · Updated 10 Sept 2026
Affected packages
semvernpm
- Affected
- >=7.0.0 <7.5.2
- Fixed in
- 7.5.2
Update to the fixed version for your release line, for example:
npm install semver@7.5.2semvernpm
- Affected
- >=6.0.0 <6.3.1
- Fixed in
- 6.3.1
Update to the fixed version for your release line, for example:
npm install semver@6.3.1semvernpm
- Affected
- >=2.0.0-alpha <5.7.2
- Fixed in
- 5.7.2
Update to the fixed version for your release line, for example:
npm install semver@5.7.2Details
Versions of the package semver before 7.5.2 on the 7.x branch, before 6.3.1 on the 6.x branch, and all other versions before 5.7.2 are vulnerable to Regular Expression Denial of Service (ReDoS) via the function new Range, when untrusted user data is provided as a range.
Is GHSA-c2qf-rxjj-qqgw in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected semver, and gives you the command that fixes it.
References
- Advisorynvd.nist.gov/vuln/detail/CVE-2022-25883
- Linkgithub.com/npm/node-semver/pull/564
- Linkgithub.com/npm/node-semver/pull/585
- Linkgithub.com/npm/node-semver/pull/593
- Linkgithub.com/npm/node-semver/commit/2f8fd41487acf380194579ecb6f8b1bbfe116be0
- Linkgithub.com/npm/node-semver/commit/717534ee353682f3bcf33e60a8af4292626d4441
- Linkgithub.com/npm/node-semver/commit/928e56d21150da0413a3333a3148b20e741a920c
- Packagegithub.com/npm/node-semver
- Linkgithub.com/npm/node-semver/blob/main/classes/range.js#L97-L104
- Linkgithub.com/npm/node-semver/blob/main/classes/range.js%23L97-L104
- Linkgithub.com/npm/node-semver/blob/main/internal/re.js#L138
- Linkgithub.com/npm/node-semver/blob/main/internal/re.js#L160
- Linkgithub.com/npm/node-semver/blob/main/internal/re.js%23L138
- Linkgithub.com/npm/node-semver/blob/main/internal/re.js%23L160
- Linksecurity.netapp.com/advisory/ntap-20241025-0004
- Linksecurity.snyk.io/vuln/SNYK-JS-SEMVER-3247795
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.