CVE DatabaseCVE-2021-21315
한국어 권고문 →
CVE-2021-213157.8/HIGHCISA KEVCWE-78CWE-78

Node.js systeminformation Command Injection Vulnerability (CVE-2021-21315)

⚡ Jump to Patch
Affected Vendors
systeminformation
Affected Components
systeminformation
Published Date
2021-02-16
CVSS v3.1
7.8
HIGH
EPSS (30d)
90.7%
FIRST.org
CISA KEV
Exploited

Executive & SecOps Summary

SECOPS ASSESSMENT
Affected Scope

Applications running Node.js environments utilizing the 'systeminformation' npm package versions prior to 5.3.1

Impact

Remote attackers can inject and execute arbitrary system commands via parameter manipulation, potentially leading to full host compromise

Mitigation

Immediately upgrade the 'systeminformation' package to version 5.3.1 or higher

Affected Products & Version Scope

All versions of the systeminformation npm package prior to 5.3.1

Remediation & Live Workaround Commands

PATCH & WORKAROUND

1. Official Patch & Version Upgrade Commands

Inspect your project's dependency tree and immediately upgrade the 'systeminformation' package to a secure version (5.3.1 or higher).

bash
# For npm users
npm install systeminformation@5.3.1

# For yarn users
yarn add systeminformation@5.3.1

# Verify and audit indirect dependencies
npm audit

2. Temporary Workaround & Hardening Configuration

If an immediate upgrade is not feasible, implement strict input validation in your application code. Ensure that all parameters passed to the vulnerable functions are strictly validated as strings and that array inputs are explicitly rejected.

javascript
// Example input validation middleware in Express.js
function sanitizeInput(req, res, next) {
  const target = req.body.target;
  
  // Reject array inputs and enforce string-only validation
  if (Array.isArray(target) || typeof target !== 'string') {
    return res.status(400).json({ error: 'Invalid input type. Only strings are allowed.' });
  }
  next();
}

3. Log Audit & IoC Verification Commands

Use the following commands to check the installed version of the package and scan application logs for potential exploitation attempts.

bash
# Check the installed version of systeminformation in your project
npm list systeminformation

# Scan application logs for suspicious shell metacharacters in incoming payloads
grep -Ei '(\||;|\&|\`|\$)' /var/log/nodejs/app.log
Interactive SecOps Remediation Checklist
0/4 (0%)
Recommended Security Control & Mitigation Partner
Snyk Open Source & Container Security
Due to active exploitation in the wild, immediately upgrade the systeminformation package to version 5.3.1 or higher to secure your infrastructure.

Scan Your Repositories for Transitive Vulnerable Dependencies in 30 Seconds

Automatically detect vulnerable packages across npm, PyPI, Maven, and Go, and open automated fix Pull Requests without breaking your build.

Free Forever Tier · 1-Click GitHub/GitLab Auto-PR
Master DevSecOps: Automated SAST/SCA in GitHub Actions & Kubernetes
View Course Curriculum

Technical Root Cause & Exploitation Mechanics

1. Vulnerability Overview & Root Cause

This vulnerability (CVE-2021-21315) is a critical command injection flaw in 'systeminformation', a widely used Node.js library for retrieving system, hardware, and OS details. The root cause lies in how functions like si.inetLatency(), si.inetChecksite(), si.services(), and si.processLoad() handle input parameters before passing them to system commands. While the library properly sanitizes string inputs, it fails to validate or sanitize array inputs, allowing malicious payloads structured as arrays to bypass sanitization checks and execute arbitrary shell commands.

2. Exploitation Mechanics & Attack Scenario

An attacker exploits this vulnerability by passing an array instead of a string to the vulnerable functions. For instance, instead of a standard string parameter like si.inetLatency('google.com'), the attacker injects an array payload such as ['google.com', '; touch /tmp/pwned;']. Because the library's sanitization logic only targets string types, the array bypasses the filter and is concatenated directly into the internal shell execution command (e.g., child_process.exec). The shell then interprets the metacharacters (like ;, |, or &), executing the attacker's injected commands with the privileges of the Node.js process.

3. Infrastructure & Business Impact

This vulnerability is listed on the CISA KEV (Known Exploited Vulnerabilities) catalog and carries a high EPSS score (>0.90), indicating active exploitation in the wild. Successful exploitation allows attackers to gain unauthorized shell access to the host operating system, extract sensitive environment variables (such as API keys and database credentials), or pivot to other internal network resources. In containerized environments, this can lead to container escape attempts, posing a severe threat to the entire cloud infrastructure.

Official Vendor Advisories & References

NVD Original English Description

The System Information Library for Node.JS (npm package "systeminformation") is an open source collection of functions to retrieve detailed hardware, system and OS information. In systeminformation before version 5.3.1 there is a command injection vulnerability. Problem was fixed in version 5.3.1. As a workaround instead of upgrading, be sure to check or sanitize service parameters that are passed to si.inetLatency(), si.inetChecksite(), si.services(), si.processLoad() ... do only allow strings, reject any arrays. String sanitation works as expected.

Frequently Asked SecOps Questions (CVE-2021-21315)

FAQ

Q1. How critical is CVE-2021-21315 and is it actively exploited in the wild?

CVE-2021-21315 is rated CVSS 7.8 (HIGH) with a 30-day EPSS exploitation probability of 90.7%. It is listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, requiring immediate emergency remediation.

Q2. Which vendors and products are affected by CVE-2021-21315?

Primary impacted vendors include systeminformation across systeminformation. Scope summary: All versions of the systeminformation npm package prior to 5.3.1

Q3. What temporary mitigations or workarounds exist for CVE-2021-21315 before patching?

[Mitigation] Immediately upgrade the 'systeminformation' package to version 5.3.1 or higher Follow the CLI remediation commands and interactive SecOps checklist on this page to restrict exposure prior to your maintenance window.

SECOPS WORKBENCH INTEGRATION

Generate an Internal Engineering Notice or CISO Report for CVE-2021-21315

Instantly format this advisory into an executive CISO summary or engineering patch ticket.

Generate Report →

🔗 Related Advisories in Similar Stack (systeminformation)

View Category →
SecOps Advisory Dispatch & RSS Feed

Subscribe to Daily Vulnerability Briefings & KEV Alerts

Concise morning briefings for SecOps, DevSecOps, and SRE teams covering newly exploited CVEs and mitigation priorities.

Slack / Teams / RSS Feed:
PatchKO
CVE-2021-21315 Node.js systeminformation Command Injection Vulnerability (CVE-2021-21315) (CVSS 7.8) - Patch & Workaround | CVE Pulse