CVE-2025-22150

6.8 MEDIUM

📋 TL;DR

This vulnerability in Undici's multipart/form-data boundary generation allows attackers to predict and tamper with requests when an application sends multipart requests to attacker-controlled servers. It affects applications using Undici versions 4.5.0 through 5.28.4, 6.0.0 through 6.21.0, and 7.0.0 through 7.2.2. The issue stems from using predictable Math.random() for boundary generation instead of cryptographically secure random values.

💻 Affected Systems

Products:
  • Undici HTTP client
Versions: 4.5.0 through 5.28.4, 6.0.0 through 6.21.0, and 7.0.0 through 7.2.2
Operating Systems: All platforms running Node.js
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications using Undici's multipart/form-data functionality and sending requests to attacker-controlled servers.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could tamper with multipart requests to backend APIs, potentially leading to data manipulation, injection attacks, or unauthorized actions depending on the API functionality.

🟠

Likely Case

Request tampering in applications that send multipart requests to external, attacker-controlled endpoints, potentially causing data integrity issues or limited API abuse.

🟢

If Mitigated

No impact if applications don't send multipart requests to untrusted servers or have proper input validation and request signing.

🌐 Internet-Facing: MEDIUM - Requires specific multipart request patterns to external attacker-controlled servers, which is not common but possible in certain integrations.
🏢 Internal Only: LOW - Internal services typically don't send requests to attacker-controlled endpoints, significantly reducing attack surface.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires collecting Math.random() outputs from the target and having the application send multipart requests to attacker-controlled servers. Public research demonstrates the Math.random() prediction technique.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 5.28.5, 6.21.1, and 7.2.3

Vendor Advisory: https://github.com/nodejs/undici/security/advisories

Restart Required: Yes

Instructions:

1. Identify Undici version in package.json
2. Update to patched version: npm update undici@^5.28.5 or npm update undici@^6.21.1 or npm update undici@^7.2.3
3. Restart all Node.js applications using Undici
4. Verify update with npm list undici

🔧 Temporary Workarounds

Avoid multipart requests to untrusted servers

all

Prevent sending multipart/form-data requests to external, untrusted servers that could be attacker-controlled.

🧯 If You Can't Patch

  • Implement strict allowlisting for external endpoints that receive multipart requests from your application
  • Add request signing or integrity checks for multipart requests to detect tampering

🔍 How to Verify

Check if Vulnerable:

Check package.json or run: npm list undici | grep undici@

Check Version:

npm list undici | grep undici@

Verify Fix Applied:

Verify version is 5.28.5+, 6.21.1+, or 7.2.3+ with: npm list undici

📡 Detection & Monitoring

Log Indicators:

  • Unusual multipart request patterns to external domains
  • Failed multipart requests with boundary prediction errors

Network Indicators:

  • Multipart requests to suspicious external domains
  • Unusual boundary values in multipart requests

SIEM Query:

source="application_logs" AND (multipart_request AND external_domain) OR (boundary_prediction_error)

🔗 References

📤 Share & Export