CVE-2025-22150 Undici Uses Insufficiently Random Values

Medium 6.8 Published Updated

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.

PackageAffectedFixed in
undici npmFrom 4.5.05.28.5
undici npmFrom 4.5.05.28.5
undici npmFrom 6.0.06.21.1
undici npmFrom 6.0.06.21.1
undici npmFrom 7.0.07.2.3
undici npmFrom 7.0.07.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.

Is CVE-2025-22150 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free