ghsa-cvv5-9h9w-qp2m
Vulnerability from github
Summary
The 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.
Details
I 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.
The 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.
PoC
First, 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.
Demonstration to run ping command indefinitely:
a" | ping /t 127.0.0.1 &
Run 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
.
a" | %SystemDrive%\a\a.exe &
Then, the vulnerable function can be executed on the victim system, for example, using:
const si = require('systeminformation');
si.networkInterfaces((net) => { console.log(net) });
Now the chosen command, PING.exe
or a.exe
will be run through the cmd.exe command line.
Impact
This vulnerability may enable an attacker, depending on how the package is used, to perform remote code execution or local privilege escalation.
{ "affected": [ { "database_specific": { "last_known_affected_version_range": "\u003c= 5.23.6" }, "package": { "ecosystem": "npm", "name": "systeminformation" }, "ranges": [ { "events": [ { "introduced": "0" }, { "fixed": "5.23.7" } ], "type": "ECOSYSTEM" } ] } ], "aliases": [ "CVE-2024-56334" ], "database_specific": { "cwe_ids": [ "CWE-94" ], "github_reviewed": true, "github_reviewed_at": "2024-12-20T19:13:23Z", "nvd_published_at": "2024-12-20T21:15:10Z", "severity": "HIGH" }, "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\u0027s to demonstrate exploitation are below.\n\nDemonstration to run ping command indefinitely:\n```\na\" | ping /t 127.0.0.1 \u0026\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 \u0026\n```\n\nThen, the vulnerable function can be executed on the victim system, for example, using:\n```\nconst si = require(\u0027systeminformation\u0027);\nsi.networkInterfaces((net) =\u003e { 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", "id": "GHSA-cvv5-9h9w-qp2m", "modified": "2024-12-20T21:37:00Z", "published": "2024-12-20T19:13:23Z", "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" } ], "schema_version": "1.4.0", "severity": [ { "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", "type": "CVSS_V3" } ], "summary": "Systeminformation has command injection vulnerability in getWindowsIEEE8021x (SSID)" }
Sightings
Author | Source | Type | Date |
---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.