CVE-2020-7614

9.8 CRITICAL

📋 TL;DR

CVE-2020-7614 is a command injection vulnerability in npm-programmatic versions through 0.0.12 that allows attackers to execute arbitrary commands on the host system. The vulnerability occurs because user-controlled input is passed directly to the exec() function without proper validation. This affects any application using the vulnerable npm-programmatic package.

💻 Affected Systems

Products:
  • npm-programmatic
Versions: All versions through 0.0.12
Operating Systems: All operating systems where Node.js runs
Default Config Vulnerable: ⚠️ Yes
Notes: Any application using npm-programmatic to execute npm commands with user-controlled input is vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise with remote code execution, allowing attackers to install malware, exfiltrate data, or pivot to other systems.

🟠

Likely Case

Local privilege escalation or arbitrary command execution within the application's context, potentially leading to data theft or service disruption.

🟢

If Mitigated

Limited impact if proper input validation and sandboxing are implemented, restricting command execution to safe operations.

🌐 Internet-Facing: HIGH if vulnerable application accepts user input that flows to npm-programmatic functions.
🏢 Internal Only: MEDIUM for internal applications that process untrusted data through npm-programmatic.

🎯 Exploit Status

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

Exploitation is straightforward as it involves injecting shell commands into the vulnerable parameters.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.0.13 and later

Vendor Advisory: https://github.com/Manak/npm-programmatic/security/advisories

Restart Required: No

Instructions:

1. Update npm-programmatic to version 0.0.13 or later using 'npm update npm-programmatic'. 2. Verify the update with 'npm list npm-programmatic'. 3. Test application functionality.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Implement strict input validation and sanitization for all parameters passed to npm-programmatic functions.

Replace with Safe Alternative

all

Replace npm-programmatic with safer alternatives like child_process.spawn with proper argument escaping.

🧯 If You Can't Patch

  • Implement strict input validation and sanitization for all user inputs that flow to npm-programmatic.
  • Run the application with minimal privileges and in a sandboxed environment to limit potential damage.

🔍 How to Verify

Check if Vulnerable:

Check package.json or run 'npm list npm-programmatic' to see if version is 0.0.12 or earlier.

Check Version:

npm list npm-programmatic | grep npm-programmatic

Verify Fix Applied:

Verify npm-programmatic version is 0.0.13 or later using 'npm list npm-programmatic'.

📡 Detection & Monitoring

Log Indicators:

  • Unusual npm commands being executed
  • Suspicious command-line arguments in process logs

Network Indicators:

  • Unexpected outbound connections from the application

SIEM Query:

process.name:node AND cmdline:*npm-programmatic* AND (cmdline:*;* OR cmdline:*&* OR cmdline:*|*)

🔗 References

📤 Share & Export