Packages / systeminformation / Security
Systeminformation has a Command Injection via unsanitized interface parameter in wifi.js retry path
Affected releases · systeminformation
- 5.x5.0.0 – 5.30.7Fixed in 5.30.8
- 4.x and older1.0.0 – 4.34.23No fix, no longer updated
On 5.x, the newest line:
npm install systeminformation@5.30.8Every release on a timeline
Affected
5.0.0 – 5.30.7
336 releases
Fixed
5.30.8 – 5.33.18
39 releases, latest
Affected
4.0.0 – 4.34.23
209 releases
Affected
3.0.0 – 3.54.0
177 releases
Affected
2.0.0 – 2.0.5
6 releases
Affected
1.0.0 – 1.0.7
8 releases
What happens
Summary
A command injection vulnerability in the wifiNetworks() function allows an attacker to execute arbitrary OS commands via an unsanitized network interface parameter in the retry code path.
Details
In lib/wifi.js, the wifiNetworks() function sanitizes the iface parameter on the initial call (line 437). However, when the initial scan returns empty results, a setTimeout retry (lines 440-441) calls getWifiNetworkListIw(iface) with the original unsanitized iface value, which is passed directly to execSync('iwlist ${iface} scan').
PoC
Install
systeminformation@5.30.7Call
si.wifiNetworks('eth0; id')The first call sanitizes input, but if results are empty, the retry executes:
iwlist eth0; id scan
Impact
Remote Code Execution (RCE). Any application passing user-controlled input to si.wifiNetworks() is vulnerable to arbitrary command execution with the privileges of the Node.js process.