CVE-2024-56334 – systeminformation
Package
Manager: npm
Name: systeminformation
Vulnerable Version: >=0 <5.23.7
Severity
Level: High
CVSS v3.1: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
CVSS v4.0: CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
EPSS: 0.00285 pctl0.51476
Details
Systeminformation has command injection vulnerability in getWindowsIEEE8021x (SSID) ### 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](https://github.com/sebhildebrandt/systeminformation/blob/3a92931c7d46605ffddc1aacb97a9727273b2888/lib/network.js#L403). 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.
Metadata
Created: 2024-12-20T19:13:23Z
Modified: 2024-12-20T21:37:00Z
Source: https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/12/GHSA-cvv5-9h9w-qp2m/GHSA-cvv5-9h9w-qp2m.json
CWE IDs: ["CWE-94"]
Alternative ID: GHSA-cvv5-9h9w-qp2m
Finding: F422
Auto approve: 1