CVE-2021-22930

9.8 CRITICAL

📋 TL;DR

CVE-2021-22930 is a use-after-free vulnerability in Node.js that allows memory corruption attacks. An attacker could exploit this to execute arbitrary code or crash the Node.js process. This affects all applications running vulnerable Node.js versions before 16.6.0, 14.17.4, or 12.22.4.

💻 Affected Systems

Products:
  • Node.js
Versions: All versions before 16.6.0, 14.17.4, and 12.22.4
Operating Systems: All operating systems running Node.js
Default Config Vulnerable: ⚠️ Yes
Notes: All Node.js applications using affected versions are vulnerable regardless of configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise, data theft, or ransomware deployment.

🟠

Likely Case

Denial of service through process crashes, with potential for limited code execution in specific conditions.

🟢

If Mitigated

Process isolation and minimal privileges could limit impact to the Node.js process only.

🌐 Internet-Facing: HIGH - Node.js applications exposed to the internet are directly vulnerable to remote exploitation.
🏢 Internal Only: MEDIUM - Internal applications could be exploited by authenticated users or through lateral movement.

🎯 Exploit Status

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

Exploitation requires specific conditions but has been demonstrated in proof-of-concept code.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Node.js 16.6.0, 14.17.4, or 12.22.4 and later

Vendor Advisory: https://nodejs.org/en/blog/vulnerability/july-2021-security-releases-2/

Restart Required: Yes

Instructions:

1. Check current Node.js version with 'node --version'. 2. Update using your package manager: 'npm install -g n' then 'n latest' for Linux/macOS, or download installer from nodejs.org for Windows. 3. Restart all Node.js applications and services.

🔧 Temporary Workarounds

Network isolation

all

Restrict network access to Node.js applications to trusted sources only

Process sandboxing

linux

Run Node.js in containers or with minimal privileges to limit exploit impact

docker run --read-only --cap-drop=ALL node:16.6.0

🧯 If You Can't Patch

  • Implement strict network segmentation and firewall rules to limit access to Node.js applications
  • Deploy runtime application self-protection (RASP) or web application firewall (WAF) with memory protection rules

🔍 How to Verify

Check if Vulnerable:

Run 'node --version' and check if version is below 16.6.0, 14.17.4, or 12.22.4

Check Version:

node --version

Verify Fix Applied:

Run 'node --version' and confirm version is 16.6.0+, 14.17.4+, or 12.22.4+

📡 Detection & Monitoring

Log Indicators:

  • Unexpected process crashes
  • Memory access violation errors
  • Abnormal child process spawning

Network Indicators:

  • Unusual outbound connections from Node.js process
  • Exploit kit traffic patterns

SIEM Query:

process.name:"node" AND (event.action:"crash" OR memory.violation:"use-after-free")

🔗 References

📤 Share & Export