CVE-2026-22036

5.9 MEDIUM

📋 TL;DR

This vulnerability in Undici HTTP client allows a malicious server to send specially crafted compressed responses that force the client to perform excessive decompression steps, causing high CPU usage and memory allocation. It affects Node.js applications using vulnerable Undici versions to make HTTP requests to untrusted servers. The impact is denial of service through resource exhaustion.

💻 Affected Systems

Products:
  • Undici HTTP client for Node.js
Versions: All versions prior to 7.18.0 and 6.23.0
Operating Systems: All platforms running Node.js
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications using Undici to make HTTP requests. The default maxHeaderSize setting enables exploitation.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete denial of service for the Node.js application due to CPU and memory exhaustion, potentially causing application crashes or unresponsiveness.

🟠

Likely Case

Degraded performance and increased resource consumption when interacting with malicious or compromised servers, leading to service disruption.

🟢

If Mitigated

Minimal impact if patched or if applications only communicate with trusted servers.

🌐 Internet-Facing: MEDIUM - Applications making HTTP requests to external, untrusted servers are vulnerable to DoS attacks.
🏢 Internal Only: LOW - Applications only communicating with trusted internal services have limited exposure.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires control of the server responding to HTTP requests. No authentication needed on client side.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 7.18.0 or 6.23.0

Vendor Advisory: https://github.com/nodejs/undici/security/advisories/GHSA-g9mf-h72j-4rw9

Restart Required: Yes

Instructions:

1. Update Undici dependency to version 7.18.0 or higher (for major version 7) or 6.23.0 or higher (for major version 6). 2. Run 'npm update undici' or 'yarn upgrade undici'. 3. Restart your Node.js application.

🔧 Temporary Workarounds

Limit maxHeaderSize

all

Reduce the maximum allowed header size to limit compression chain exploitation

const { Client } = require('undici');
const client = new Client('http://example.com', { maxHeaderSize: 16384 });

Disable compression

all

Configure Undici to not accept compressed responses

const { Client } = require('undici');
const client = new Client('http://example.com', { headers: { 'accept-encoding': 'identity' } });

🧯 If You Can't Patch

  • Implement network filtering to restrict HTTP requests to trusted servers only
  • Monitor CPU and memory usage for abnormal spikes during HTTP operations

🔍 How to Verify

Check if Vulnerable:

Check package.json or run 'npm list undici' to see installed version. If version is below 7.18.0 (for v7) or below 6.23.0 (for v6), you are vulnerable.

Check Version:

npm list undici | grep undici

Verify Fix Applied:

After updating, verify with 'npm list undici' that version is 7.18.0+ or 6.23.0+. Test HTTP requests to ensure normal operation.

📡 Detection & Monitoring

Log Indicators:

  • Unusual CPU spikes during HTTP requests
  • Memory allocation errors in Node.js logs
  • Slow response times from HTTP client operations

Network Indicators:

  • HTTP responses with unusually large or complex compression headers
  • Requests to suspicious or untrusted servers

SIEM Query:

source="nodejs" AND ("CPU spike" OR "memory allocation" OR "slow http") AND process="node"

🔗 References

📤 Share & Export