undici

CVE-2025-22150

CVE-2025-22150 is a medium-severity use of insufficiently random values vulnerability in undici (npm), affecting versions >= 4.5.0, < 5.28.5. It is fixed in 5.28.5, 6.21.1, 7.2.3.

Key facts
CVSS score
6.8
Medium
Attack vector
Network
Issuing authority
GitHub Advisory Database
Affected package
undici
Fixed in
5.28.5, 6.21.1, 7.2.3
Disclosed
2025

Summary

Impact Undici fetch() uses Math.random() to choose the boundary for a multipart/form-data request. It is known that the output of Math.random() can be predicted if several of its generated values are known. If there is a mechanism in an app that sends multipart requests to an attacker-controlled website, they can use this to leak the necessary values. Therefore, An attacker can tamper with the requests going to the backend APIs if certain conditions are met. Patches This is fixed in 5.28.5; 6.21.1; 7.2.3. Workarounds Do not issue multipart requests to attacker controlled servers. References https://hackerone.com/reports/2913312 https://blog.securityevaluators.com/hacking-the-javascript-lottery-80cc437e3b7f

Impact

What is use of insufficiently random values?

Security-sensitive operations rely on values that are predictable or insufficiently random. Typical impact: forged tokens, guessable identifiers, or broken cryptographic protocols.

Severity and exposure

CVE-2025-22150 has a CVSS score of 6.8 (Medium). The vector is network-reachable, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment.

A fixed version is available (5.28.5, 6.21.1, 7.2.3). Upgrading removes the vulnerable code path.

Affected versions

npm

  • undici (>= 4.5.0, < 5.28.5)
  • undici (>= 6.0.0, < 6.21.1)
  • undici (>= 7.0.0, < 7.2.3)

Security releases

  • undici → 5.28.5 (npm)
  • undici → 6.21.1 (npm)
  • undici → 7.2.3 (npm)
Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter instead of chasing every advisory.

Kodem's runtime-powered SCA identifies whether CVE-2025-22150 is reachable in your applications. Explore open-source security for your team.

See if CVE-2025-22150 is reachable in your applications. Get a demo

Remediation advice

Upgrade the following packages to resolve this vulnerability:

  • Upgrade undici to 5.28.5 or later
  • Upgrade undici to 6.21.1 or later
  • Upgrade undici to 7.2.3 or later

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently asked questions about CVE-2025-22150

What is CVE-2025-22150?

CVE-2025-22150 is a medium-severity use of insufficiently random values vulnerability in undici (npm), affecting versions >= 4.5.0, < 5.28.5. It is fixed in 5.28.5, 6.21.1, 7.2.3. Security-sensitive operations rely on values that are predictable or insufficiently random.

How severe is CVE-2025-22150?

CVE-2025-22150 has a CVSS score of 6.8 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.

Which versions of undici are affected by CVE-2025-22150?

undici (npm) versions >= 4.5.0, < 5.28.5 is affected.

Is there a fix for CVE-2025-22150?

Yes. CVE-2025-22150 is fixed in 5.28.5, 6.21.1, 7.2.3. Upgrade to this version or later.

Is CVE-2025-22150 exploitable, and should I be worried?

Whether CVE-2025-22150 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo

What actually determines whether CVE-2025-22150 is exploitable, and how bad it is?

Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.

How do I fix CVE-2025-22150?
  • Upgrade undici to 5.28.5 or later
  • Upgrade undici to 6.21.1 or later
  • Upgrade undici to 7.2.3 or later

Stop the waste.
Protect your environment with Kodem.