CVE-2020-28494

8.6 HIGH

📋 TL;DR

This vulnerability allows remote command injection in total.js framework versions before 3.4.7. Attackers can execute arbitrary commands on the server by exploiting insufficient input sanitization in image processing functions. Any application using vulnerable total.js versions with image.pipe or image.stream functions is affected.

💻 Affected Systems

Products:
  • total.js framework
Versions: All versions before 3.4.7
Operating Systems: All platforms running Node.js
Default Config Vulnerable: ⚠️ Yes
Notes: Applications must use image.pipe() or image.stream() functions to be vulnerable. The vulnerability exists in the framework itself, not specific applications.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full server compromise allowing arbitrary command execution, data exfiltration, lateral movement, and persistent backdoor installation.

🟠

Likely Case

Remote code execution leading to application takeover, data theft, or cryptocurrency mining malware deployment.

🟢

If Mitigated

Limited impact if proper input validation and command sanitization are implemented, potentially reduced to denial of service.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires minimal technical skill due to public proof-of-concept and simple command injection pattern.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 3.4.7 and later

Vendor Advisory: https://github.com/totaljs/framework/commit/6192491ab2631e7c1d317c221f18ea613e2c18a5

Restart Required: Yes

Instructions:

1. Update total.js package: npm update total.js
2. Verify version is 3.4.7 or higher
3. Restart the Node.js application
4. Test image processing functionality

🔧 Temporary Workarounds

Input validation wrapper

all

Add custom input validation for image.pipe and image.stream parameters

// Add validation before calling image functions
const validateType = (type) => {
  const allowed = ['png', 'jpg', 'jpeg', 'gif'];
  if (!allowed.includes(type.toLowerCase())) {
    throw new Error('Invalid image type');
  }
  return type;
}

🧯 If You Can't Patch

  • Implement strict input validation for all image processing parameters
  • Disable or restrict access to image processing endpoints if not essential

🔍 How to Verify

Check if Vulnerable:

Check package.json for total.js version <3.4.7 or run: npm list total.js

Check Version:

npm list total.js | grep total.js

Verify Fix Applied:

Verify total.js version is >=3.4.7 and test image processing with malicious input

📡 Detection & Monitoring

Log Indicators:

  • Unusual child_process.spawn commands in logs
  • Image processing requests with shell metacharacters
  • Unexpected system command execution

Network Indicators:

  • HTTP requests to image endpoints containing shell commands
  • Unusual outbound connections from Node.js process

SIEM Query:

process.name:node.exe AND cmdline:*spawn* AND cmdline:*shell*

🔗 References

📤 Share & Export