CVE-2025-22150 Undici Uses Insufficiently Random Values
Attackers can predict multipart boundaries in Undici HTTP client requests, allowing them to tamper with data sent to backend APIs.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2025-22150?
CVE-2025-22150 is a medium-severity vulnerability in nodejs undici, published on 21 Jan 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
Undici is an HTTP/1.1 client. Starting in version 4.5.0 and prior to versions 5.28.5, 6.21.1, and 7.2.3, undici 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. This is fixed in versions 5.28.5, 6.21.1, and 7.2.3. As a workaround, do not issue multipart requests to attacker controlled servers.
Weakness: CWE-330
Which versions are affected by CVE-2025-22150?
6 open source packages ship an affected version, including undici.
| Package | Affected | Fixed in |
|---|---|---|
undici npm | From 4.5.0 | 5.28.5 |
undici npm | From 4.5.0 | 5.28.5 |
undici npm | From 6.0.0 | 6.21.1 |
undici npm | From 6.0.0 | 6.21.1 |
undici npm | From 7.0.0 | 7.2.3 |
undici npm | From 7.0.0 | 7.2.3 |
How do I fix CVE-2025-22150?
Upgrade undici to a fixed version for your release line: 5.28.5, 6.21.1 or 7.2.3.
Is CVE-2025-22150 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-22150 exists.
Sources
Also known as ALPINE-CVE-2025-22150, AZL-55931, AZL-55950, BELL-CVE-2025-22150, CLSA-2025-1758102713, DEBIAN-CVE-2025-22150 and 8 more.