CVE-2024-21891

8.8 HIGH

📋 TL;DR

This vulnerability allows attackers to bypass Node.js's experimental permission model by overwriting built-in path normalization functions, enabling path traversal attacks that can access restricted files. It affects all users running Node.js 20 or 21 with the experimental permission model enabled. Since the permission model is experimental, this primarily impacts developers testing this feature.

💻 Affected Systems

Products:
  • Node.js
Versions: Node.js 20.x and 21.x (all versions before patched releases)
Operating Systems: All platforms running affected Node.js versions
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when the experimental permission model is explicitly enabled via --experimental-permission flag. The permission model is disabled by default as it's an experimental feature.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete filesystem access bypass allowing reading, writing, or deleting any file accessible to the Node.js process, potentially leading to data theft, system compromise, or service disruption.

🟠

Likely Case

Limited file access bypass within the application's context, potentially exposing sensitive configuration files, logs, or application data.

🟢

If Mitigated

No impact if the experimental permission model is disabled, as the vulnerability only exists when this feature is actively being used.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires the ability to execute arbitrary JavaScript code within the Node.js process. The HackerOne report demonstrates working proof-of-concept.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Node.js 20.11.1 and 21.6.2

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

Restart Required: Yes

Instructions:

1. Check current Node.js version: node --version
2. Update to patched version:
- For Node.js 20: Update to 20.11.1 or later
- For Node.js 21: Update to 21.6.2 or later
3. Restart all Node.js applications and services

🔧 Temporary Workarounds

Disable Experimental Permission Model

all

Remove --experimental-permission flag from Node.js startup commands

Remove '--experimental-permission' from all Node.js startup scripts and configurations

🧯 If You Can't Patch

  • Disable the experimental permission model immediately by removing --experimental-permission flag
  • Implement strict input validation and sanitization for all file path inputs in your application

🔍 How to Verify

Check if Vulnerable:

Check if Node.js version is 20.x or 21.x AND the --experimental-permission flag is being used

Check Version:

node --version

Verify Fix Applied:

Verify Node.js version is 20.11.1+ or 21.6.2+ and restart applications

📡 Detection & Monitoring

Log Indicators:

  • Unusual file access patterns, permission model bypass attempts, path traversal patterns in file operations

Network Indicators:

  • N/A - This is a local filesystem vulnerability

SIEM Query:

Search for Node.js processes running with --experimental-permission flag on versions 20.x or 21.x before patched versions

🔗 References

📤 Share & Export