# CVE-2021-21315: System Information Library for Node.JS Command Injection


- **Severity:** High 7.1 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N`)
- **Exploited in the wild:** Yes, since 18 Jan 2022 (CISA KEV)
- **Fix available:** Yes
- **Published:** 16 Feb 2021
- **Updated:** 21 Oct 2025
- **Also known as:** GHSA-2m8v-572m-ff2v

## What is CVE-2021-21315?

CVE-2021-21315 is a high-severity vulnerability in sebhildebrandt systeminformation, published on 16 Feb 2021. 

### Official 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.

Weakness: CWE-78 (Improper Neutralization of Special Elements used in an OS Command)

## Which versions are affected by CVE-2021-21315?

2 open source packages ship an affected version, including systeminformation. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `systeminformation` | npm | All versions | 5.3.1 |
| `systeminformation` | npm | All versions | 5.3.1 |

Products: Apache Cordova, Systeminformation Systeminformation.

## How do I fix CVE-2021-21315?

Upgrade systeminformation to 5.3.1 or later. US federal agencies must fix it by 1 Feb 2022.

## Is CVE-2021-21315 being exploited?

Yes. Attackers have exploited CVE-2021-21315 in the wild since at least 18 Jan 2022.

Public exploit code:

- CVE 2021-21315 PoC (github_poc): https://github.com/ForbiddenProgrammer/CVE-2021-21315-PoC
- https://github.com/alikarimi999/CVE-2021-21315 (github_poc): https://github.com/alikarimi999/CVE-2021-21315
- rust noob tried write easy exploit code with rust lang (github_poc): https://github.com/G01d3nW01f/CVE-2021-21315
- systeminformation (github_poc): https://github.com/MazX0p/CVE-2021-21315-exploit
- https://github.com/xMohamed0/CVE-2021-21315-POC (github_poc): https://github.com/xMohamed0/CVE-2021-21315-POC
- Thesis scenario test (research only): Scenario D: KEV override path - systeminformation@5.3.0 CVE-2021-21315 (github_poc): https://github.com/jimahub/scenario-d-kev

## Other vulnerabilities in sebhildebrandt systeminformation

- [CVE-2014-0073](https://insights.sbomify.com/CVE-2014-0073/): Cross-site scripting in n/a (critical 9.8)
- [CVE-2014-0072](https://insights.sbomify.com/CVE-2014-0072/): Security feature bypass in n/a (high 7.5)
- [CVE-2016-6799](https://insights.sbomify.com/CVE-2016-6799/): Information Exposure in cordova-android (high 7.5)
- [CVE-2017-3160](https://insights.sbomify.com/CVE-2017-3160/): Supply chain in Apache Cordova Android (high 7.4)
- [CVE-2014-3500](https://insights.sbomify.com/CVE-2014-3500/): Other in n/a (medium 6.4)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-21315 and fix it if it is affected.

What it is: CVE-2021-21315 is a high-severity vulnerability in sebhildebrandt systeminformation, published on 16 Feb 2021. 
Exploitation: Yes. Attackers have exploited CVE-2021-21315 in the wild since at least 18 Jan 2022.

Affected packages and fixed versions:
- systeminformation (npm): affected all versions; fixed in 5.3.1
- systeminformation (npm): affected all versions; fixed in 5.3.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2021-21315/ (Markdown: https://insights.sbomify.com/CVE-2021-21315/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2021-21315
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2021-21315
- OSV: https://osv.dev/vulnerability/CVE-2021-21315

---
From sbomify Insights: https://insights.sbomify.com/CVE-2021-21315/
Summaries are generated and may contain mistakes; the official description above is the record.
