CVE-2021-21297

7.7 HIGH

📋 TL;DR

CVE-2021-21297 is a prototype pollution vulnerability in Node-RED's admin API that allows attackers to modify JavaScript object prototypes, potentially altering the runtime behavior of Node-RED applications. This affects all Node-RED instances running versions 1.2.7 or earlier. Attackers can exploit this vulnerability through specially crafted requests to the admin API.

💻 Affected Systems

Products:
  • Node-RED
Versions: All versions up to and including 1.2.7
Operating Systems: All operating systems running Node.js
Default Config Vulnerable: ⚠️ Yes
Notes: Default installations with the admin/editor interface accessible are vulnerable. The vulnerability exists in the @node-red/editor-api and @node-red/runtime packages.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution, complete system compromise, or denial of service by polluting critical object prototypes and altering application behavior.

🟠

Likely Case

Application instability, denial of service, or privilege escalation through prototype manipulation affecting Node-RED functionality.

🟢

If Mitigated

Limited impact if proper authentication and authorization controls prevent unauthorized access to the admin API.

🌐 Internet-Facing: HIGH - If the Node-RED editor/admin interface is exposed to the internet without proper authentication, attackers can directly exploit this vulnerability.
🏢 Internal Only: MEDIUM - Internal attackers or compromised internal systems could exploit this if they can reach the Node-RED admin interface.

🎯 Exploit Status

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

Exploitation requires sending specially crafted requests to the admin API endpoints. Proof-of-concept code is available in security advisories.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.2.8 and later

Vendor Advisory: https://github.com/node-red/node-red/security/advisories/GHSA-xp9c-82x8-7f67

Restart Required: Yes

Instructions:

1. Update Node-RED using npm: 'npm install -g node-red@latest' 2. Restart the Node-RED service 3. Verify version is 1.2.8 or higher

🔧 Temporary Workarounds

Restrict Admin API Access

all

Ensure only authorized users can access the Node-RED editor/admin interface by implementing proper authentication and network access controls.

Configure Node-RED settings.js to enable authentication
Use reverse proxy with authentication
Implement network firewall rules to restrict access

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate Node-RED instances from untrusted networks
  • Enable and enforce authentication for all admin API access with strong credentials

🔍 How to Verify

Check if Vulnerable:

Check Node-RED version: 'node-red --version' or examine package.json. If version is 1.2.7 or earlier, the system is vulnerable.

Check Version:

node-red --version

Verify Fix Applied:

After patching, verify version is 1.2.8 or higher: 'node-red --version' should show 1.2.8+

📡 Detection & Monitoring

Log Indicators:

  • Unusual POST/PUT requests to /admin/* endpoints
  • Requests with malformed JSON payloads to admin API
  • Error logs mentioning prototype pollution or object manipulation

Network Indicators:

  • HTTP requests to Node-RED admin endpoints from unexpected sources
  • Unusual traffic patterns to /admin/* paths

SIEM Query:

source="node-red" AND (uri_path="/admin/*" AND (http_method="POST" OR http_method="PUT") AND status_code=200)

🔗 References

📤 Share & Export