CVE-2024-56334: Systeminformation Systeminformation Has Command Injection Vulnerability Vulnerability
HIGHCVE-2024-56334 is a HIGH (CVSS 7.8) systeminformation has command injection vulnerability vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Systeminformation libraries in the npm ecosystem. The issue involves systeminformation has command injection vulnerability in getwindowsieee8021x (ssid). Remediation is available by upgrading affected packages to version 5.23.7.
CVE-2024-56334 at a Glance
Security Impact
CVSS: 7.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2024-56334
To remediate this vulnerability, upgrade all affected Systeminformation dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install systeminformation@5.23.7
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls systeminformation
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-56334, inspect your project dependencies using npm:
npm ls systeminformation
Analyze the terminal output to locate any version of Systeminformation in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.23.7), your application is affected.
Note: The npm ls systeminformation command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Systeminformation, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-56334 Affected Systeminformation Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
systeminformation
|
npm |
< 5.23.7
|
5.23.7
|
References
Frequently Asked Questions
What is CVE-2024-56334?
Which Systeminformation versions are affected?
What version fixes CVE-2024-56334?
Is systeminformation affected?
What is the CVSS score of CVE-2024-56334?
What CWE is associated with CVE-2024-56334?
How can I check npm dependencies for CVE-2024-56334?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cvv5-9h9w-qp2m",
"modified" : "2024-12-20T21:37:00Z",
"published" : "2024-12-20T19:13:23Z",
"aliases" : [ "CVE-2024-56334" ],
"summary" : "Systeminformation has command injection vulnerability in getWindowsIEEE8021x (SSID)",
"details" : "### Summary\nThe SSID is not sanitized when before it is passed as a parameter to cmd.exe in the `getWindowsIEEE8021x` function. This means that malicious content in the SSID can be executed as OS commands. \n\n### Details\nI have exploited this vulnerability in a Windows service using version 5.22.11 of the module, to escalate privileges (in an environment where I am authorized to do so). However, as far as I can see from the code, it is still present in master branch at time of writing, on line [403/404 of network.js](https://github.com/sebhildebrandt/systeminformation/blob/3a92931c7d46605ffddc1aacb97a9727273b2888/lib/network.js#L403).\n\nThe SSID is obtained from `netsh wlan show interface ...` in `getWindowsWirelessIfaceSSID`, and then passed to `cmd.exe /d /s /c \"netsh wlan show profiles ...` in `getWindowsIEEE8021x`, without sanitization.\n\n### PoC\nFirst, the command injection payload should be included in the connected Wi-Fi SSID. For example create hotspot on mobile phone or other laptop, set SSID to payload, connect to it with victim Windows system. Two example SSID's to demonstrate exploitation are below.\n\nDemonstration to run ping command indefinitely:\n```\na\" | ping /t 127.0.0.1 &\n```\n\nRun executable with privileges of the user in which vulnerable function is executed. Chosen executable should should be placed in (assuming system drive is C): `C:\\a\\a.exe`.\n```\na\" | %SystemDrive%\\a\\a.exe &\n```\n\nThen, the vulnerable function can be executed on the victim system, for example, using:\n```\nconst si = require('systeminformation');\nsi.networkInterfaces((net) => { console.log(net) });\n```\n\nNow the chosen command, `PING.exe` or `a.exe` will be run through the cmd.exe command line.\n\n### Impact\nThis vulnerability may enable an attacker, depending on how the package is used, to perform remote code execution or local privilege escalation.\n\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "systeminformation"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.23.7"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 5.23.6"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/sebhildebrandt/systeminformation/security/advisories/GHSA-cvv5-9h9w-qp2m"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-56334"
}, {
"type" : "WEB",
"url" : "https://github.com/sebhildebrandt/systeminformation/commit/f7af0a67b78e7894335a6cad510566a25e06ae41"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/sebhildebrandt/systeminformation"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-12-20T19:13:23Z",
"nvd_published_at" : "2024-12-20T21:15:10Z"
}
}