CVE-2021-23389

9.8 CRITICAL

📋 TL;DR

This vulnerability allows remote attackers to execute arbitrary code on systems running vulnerable versions of total.js framework. Attackers can exploit the U.set() and U.get() utility functions to inject and execute malicious code. Any application using total.js versions before 3.4.9 is affected.

💻 Affected Systems

Products:
  • total.js framework
Versions: All versions before 3.4.9
Operating Systems: All platforms running Node.js
Default Config Vulnerable: ⚠️ Yes
Notes: Any application using the vulnerable U.set() or U.get() functions is affected regardless of configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise allowing attackers to execute arbitrary commands, steal data, install malware, or pivot to other systems.

🟠

Likely Case

Remote code execution leading to data theft, service disruption, or deployment of ransomware.

🟢

If Mitigated

Limited impact if proper input validation and sandboxing are implemented, though the vulnerability still exists.

🌐 Internet-Facing: HIGH - The vulnerability can be exploited remotely without authentication, making internet-facing applications particularly vulnerable.
🏢 Internal Only: HIGH - Even internal applications can be exploited by authenticated users or through other attack vectors.

🎯 Exploit Status

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

Exploitation is straightforward as the vulnerable functions are commonly used and the attack vector is well-documented.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 3.4.9 and later

Vendor Advisory: https://github.com/totaljs/framework/commit/887b0fa9e162ef7a2dd9cec20a5ca122726373b3

Restart Required: Yes

Instructions:

1. Update total.js package to version 3.4.9 or later using npm update totaljs. 2. Restart the application. 3. Verify the update was successful.

🔧 Temporary Workarounds

Input Validation Wrapper

all

Wrap U.set() and U.get() calls with strict input validation to prevent code injection

// Implement input validation before calling U.set() or U.get()
// Example: if (typeof input !== 'string' || input.includes('__proto__')) throw new Error('Invalid input');

🧯 If You Can't Patch

  • Implement strict input validation and sanitization for all user inputs
  • Deploy web application firewall (WAF) rules to detect and block exploitation attempts

🔍 How to Verify

Check if Vulnerable:

Check package.json for total.js version or run npm list totaljs

Check Version:

npm list totaljs | grep totaljs

Verify Fix Applied:

Verify total.js version is 3.4.9 or higher using npm list totaljs

📡 Detection & Monitoring

Log Indicators:

  • Unusual process execution patterns
  • Suspicious JavaScript evaluation in logs
  • Unexpected system commands from Node.js processes

Network Indicators:

  • Unusual outbound connections from Node.js applications
  • Suspicious payloads in HTTP requests

SIEM Query:

process.name:node.exe AND (process.cmdline:*U.set* OR process.cmdline:*U.get*) AND process.cmdline:*eval*

🔗 References

📤 Share & Export