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.
This is fixed in 5.28.5; 6.21.1; 7.2.3.
Do not issue multipart requests to attacker controlled servers.
| Score | Percentile |
|---|---|
| 0.60% | 69.52% |
| Base score | Version | Severity | Vector |
|---|---|---|---|
| 6.8 | 3.1 | — |
|
| Type | Value |
|---|---|
| GHSA | GHSA-c76h-2ccp-4975 ↗ |
| CVE | CVE-2025-22150 ↗ |
| CWE id | Name |
|---|---|
| CWE-330 | Use of Insufficiently Random Values |
Vulnerable version ranges and first patched releases as published by GitHub.
| Ecosystem | Package | Vulnerable range | First patched | Vulnerable functions |
|---|---|---|---|---|
| npm | undici | >= 4.5.0, < 5.28.5 | 5.28.5 | — |
| npm | undici | >= 6.0.0, < 6.21.1 | 6.21.1 | — |
| npm | undici | >= 7.0.0, < 7.2.3 | 7.2.3 | — |