CVE-2024-27982

6.5 MEDIUM

📋 TL;DR

This vulnerability in Node.js HTTP server allows HTTP request smuggling when a space precedes the Content-Length header. Attackers can inject a second request within the first request's body, potentially bypassing security controls. All systems running vulnerable Node.js versions with HTTP servers are affected.

💻 Affected Systems

Products:
  • Node.js
Versions: Node.js 20.x before 20.11.1, 18.x before 18.19.1
Operating Systems: All operating systems running Node.js
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects HTTP servers using Node.js's built-in HTTP module. Applications using alternative HTTP libraries may not be vulnerable.

⚠️ 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 bypass authentication, access control, or web application firewalls to perform privilege escalation, data theft, or server-side request forgery.

🟠

Likely Case

Attackers could bypass security filters, cache poisoning, or perform session hijacking through request smuggling.

🟢

If Mitigated

With proper WAF configuration and request validation, impact is limited to potential request parsing anomalies.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires sending specially crafted HTTP requests with malformed headers.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Node.js 20.11.1, 18.19.1

Vendor Advisory: https://nodejs.org/en/blog/vulnerability/february-2024-security-releases/

Restart Required: Yes

Instructions:

1. Check current Node.js version with 'node --version'. 2. Update using package manager: 'npm install -g n' then 'n 20.11.1' or 'n 18.19.1'. 3. Restart all Node.js applications and services.

🔧 Temporary Workarounds

Request Header Validation

all

Implement middleware to validate and normalize HTTP headers before processing

// Example Express middleware:
app.use((req, res, next) => {
  const headers = req.headers;
  Object.keys(headers).forEach(key => {
    if (key.includes('content-length') && headers[key].startsWith(' ')) {
      headers[key] = headers[key].trim();
    }
  });
  next();
});

🧯 If You Can't Patch

  • Deploy a web application firewall (WAF) with HTTP request smuggling protection rules
  • Implement reverse proxy with strict HTTP header validation and normalization

🔍 How to Verify

Check if Vulnerable:

Check if Node.js version is between 20.0.0-20.11.0 or 18.0.0-18.19.0

Check Version:

node --version

Verify Fix Applied:

Verify Node.js version is 20.11.1 or 18.19.1 or higher

📡 Detection & Monitoring

Log Indicators:

  • Unusual HTTP 400 responses
  • Requests with malformed Content-Length headers
  • Multiple requests appearing as single request in logs

Network Indicators:

  • HTTP requests with spaces before Content-Length header
  • Unexpected request smuggling patterns

SIEM Query:

source="web_server" AND (http_header=" content-length" OR http_header="Content-Length ")

🔗 References

📤 Share & Export