
Cloud Vulnerability DB
A community-led vulnerabilities database
systeminformation resolves the path to the ip binary by running which ip through a shell, applies only a minimal check to the result, and then interpolates that unsanitized path directly into a second shell command that is executed with execSync(). The affected code is in getMacAddresses() in lib/network.js. If the Node.js process runs on Linux (or FreeBSD/OpenBSD/NetBSD) with a PATH entry whose directory name contains shell metacharacters and that directory contains an ip executable, the metacharacters are interpreted by /bin/sh, giving an attacker who can influence PATH (or the filesystem reachable through it) arbitrary OS command execution in the context of the Node.js process.
The function trusts the output of which ip as if it were a safe absolute path. The only validation applied is that the first result line contains no colon and begins with /. That check rejects a relative path and a Windows-style drive path, but it permits every shell metacharacter other than :, including $, backtick, (, ), ;, &, |, {, }, <, >, and spaces. The validated string is stored in a module-level cache and later concatenated into a command string that is run through a shell, so any metacharacter in the resolved path is executed rather than treated as part of a filename. The codebase ships a sanitizeShellString() helper, but it is never applied to this value.
// lib/network.js (getMacAddresses)
// line 143: const lines = execSync('which ip', util.execOptsLinux).toString().split('\n');
// line 144: if (lines.length && lines[0].indexOf(':') === -1 && lines[0].indexOf('/') === 0) {
// line 145: pathToIp = lines[0];
// line 154: const cmd = 'export LC_ALL=C; ' + (pathToIp ? pathToIp + ' link show up' : '/sbin/ifconfig') + '; unset LC_ALL';
// line 155: const res = execSync(cmd, util.execOptsLinux);
// Affected function: getMacAddresses (lib/network.js)An attacker who can place a metacharacter-named directory on the process PATH with an ip executable inside it (or otherwise influence what which ip resolves to) achieves arbitrary command execution as the user running the Node.js process. The vulnerable path runs by default on Linux and BSD systems: it triggers on the first call to getMacAddresses() and through networkInterfaces() on the supported fallback paths, with no authentication and no further user interaction once the PATH condition exists. Because execution occurs within the process's own authority, the attacker gains the full read, write, and availability capability of that process, which in a monitoring agent or backend service context is frequently a privileged service account with access to credentials, databases, or network resources. The resolved value is cached for the process lifetime, so a single poisoned resolution persists for all later calls.
Environment: Linux, Node.js, systeminformation installed locally.
The PoC prepends a directory whose name contains a command substitution
to PATH, places a symlink to the real `ip` binary inside it, then calls
getMacAddresses(). `which ip` returns the poisoned path, which is run
through /bin/sh, executing the injected command.const { execSync } = require('child_process');
const fs = require('fs');
const os = require('os');
const path = require('path');
const marker = path.join(os.tmpdir(), `si-poc-marker-${process.pid}`);
const realIp = execSync('command -v ip', { encoding: 'utf8' }).trim();
const baseDir = fs.mkdtempSync(path.join(os.tmpdir(), 'si-poc-'));
const injectDir = path.join(baseDir, `$(touch ${marker})`);
fs.mkdirSync(injectDir, { recursive: true });
fs.symlinkSync(realIp, path.join(injectDir, 'ip'));
process.env.PATH = injectDir + ':' + process.env.PATH;
const networkModulePath = require.resolve('systeminformation/lib/network');
delete require.cache[networkModulePath];
require(networkModulePath).getMacAddresses();
setTimeout(() => {
console.log(fs.existsSync(marker)
? 'VULNERABLE: injected command executed'
: 'NOT VULNERABLE');
}, 500);which ip returns: /tmp/si-poc-XXXX/$(touch /tmp/si-poc-marker-NNNN)/ip
VULNERABLE: marker file created; injected shell command executedsysteminformation and reaches getMacAddresses() directly or through networkInterfaces(); the vulnerable block runs under if (_linux || _freebsd || _openbsd || _netbsd) at lib/network.js:140.PATH so that it includes a directory whose filesystem name contains shell metacharacters (for example $(touch /tmp/pwned)) and places an ip executable or symlink inside that directory.execSync('which ip', ...) at lib/network.js:143 resolves ip to the metacharacter-containing path and returns it.lib/network.js:144 only rejects a colon and requires a leading /; the metacharacter-laden path passes and is cached in pathToIp at lib/network.js:145.lib/network.js:154 and executed through a shell by execSync() at lib/network.js:155; execOptsLinux sets no non-shell execution mode./bin/sh interprets the embedded command substitution, executing attacker-chosen commands with the privileges of the Node.js process.The relevant protection is the validation at lib/network.js:144 (lines[0].indexOf(':') === -1 && lines[0].indexOf('/') === 0). It was tested against a resolved path of the form /tmp/.../$(touch ...)/ip: the path contains no colon and starts with /, so it passes unchanged, while the command-substitution characters remain. The sanitizeShellString() routine that would strip these characters is present in lib/util.js but is never invoked on this value, which was confirmed by inspecting getMacAddresses(). Running the proof of concept against the v5.33.19 checkout produced the injected marker file, confirming shell execution. This is a distinct, never-patched code path rather than a duplicate of the prior advisory: the published advisory GHSA-5vv4-hvf7-2h46 (CVE-2026-26318) addressed unsanitized locate output in versions() in lib/osinfo.js and was fixed in 5.31.0; its fix commit did not modify getMacAddresses(), the pathToIp cache, or the which ip resolution, which have no modification history.
npmsysteminformation>= 3.50.2, <= 5.33.195.33.19 (npm registry)which ip to pathToIp to execSync pattern is absent in 3.50.1 (which used a hardcoded /sbin/ip) and first appears in 3.50.2, persisting unchanged through 5.33.19, the latest published stable release. Prerelease 6.0.0-beta versions were not inspected.execFileSync('ip', ['link', 'show', 'up'], ...) so that the path and arguments are passed directly to the executable and metacharacters are never interpreted. If shell invocation must be retained, apply the existing sanitizeShellString() to the which output, or restrict the accepted value to a strict safe-path pattern (for example only [A-Za-z0-9/_.-]) before use, and treat any non-conforming result as absent so the code falls back to a hardcoded path. The same treatment should be applied to every path obtained from which and interpolated into a command.Reported by zx.
Source: NVD
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."