7.8high
Command injection vulnerability in getWindowsIEEE8021x (SSID) function in systeminformation
- Severity
- 7.8high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.88% (higher than 57% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-cvv5-9h9w-qp2m
Description
systeminformation is a System and OS information library for node.js. In affected versions SSIDs are not sanitized when before they are 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. This vulnerability may enable an attacker, depending on how the package is used, to perform remote code execution or local privilege escalation. This issue has been addressed in version 5.23.7 and all users are advised to upgrade. There are no known workarounds for this vulnerability.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| sebhildebrandt systeminformation | < 5.23.7 | CVE List |
| systeminformation (npm) | before 5.23.7 | GitHub Advisory Database |
All scores
| GitHub_M | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| GitHub | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.
What each source says
CVE List
systeminformation is a System and OS information library for node.js. In affected versions SSIDs are not sanitized when before they are 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. This vulnerability may enable an attacker, depending on how the package is used, to perform remote code execution or local privilege escalation. This issue has been addressed in version 5.23.7 and all users are advised to upgrade. There are no known workarounds for this vulnerability.
GitHub Advisory Database
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.
NVD (es)
systeminformation es una librería de información del sistema y del SO para node.js. En las versiones afectadas, los SSID no se desinfectan antes de que se pasen como parámetro a cmd.exe en la función `getWindowsIEEE8021x`. Esto significa que el contenido malicioso en el SSID se puede ejecutar como comandos del SO. Esta vulnerabilidad puede permitir a un atacante, según cómo se use el paquete, realizar una ejecución de código remoto o una escalada de privilegios locales. Este problema se ha solucionado en la versión 5.23.7 y se recomienda a todos los usuarios que actualicen. No se conocen workarounds para esta vulnerabilidad.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-56334 changed 2024-12-24 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-cvv5-9h9w-qp2m changed 2024-12-20 | CC-BY-4.0 |
| NVD | CVE-2024-56334 changed 2026-06-17 | Public domain |