Compare commits

..

10 Commits

Author SHA1 Message Date
504ecf272d osInfo() add domain (windows)
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Test / build (16.x, macos-latest) (push) Waiting to run
Test / build (16.x, ubuntu-latest) (push) Waiting to run
Test / build (16.x, windows-latest) (push) Waiting to run
Test / build (17.x, ubuntu-latest) (push) Waiting to run
Test / build (18.x, macos-latest) (push) Waiting to run
Test / build (18.x, ubuntu-latest) (push) Waiting to run
Test / build (18.x, windows-latest) (push) Waiting to run
Test / build (19.x, ubuntu-latest) (push) Waiting to run
Test / build (20.x, macos-latest) (push) Waiting to run
Test / build (20.x, ubuntu-latest) (push) Waiting to run
Test / build (20.x, windows-latest) (push) Waiting to run
2026-02-26 21:35:34 +01:00
Sebastian Hildebrandt
91e1acf7d3 5.31.1 2026-02-17 20:15:09 +01:00
Sebastian Hildebrandt
5408bb6d1c docs updated (security advisory) 2026-02-17 20:15:03 +01:00
Sebastian Hildebrandt
2a28d2d083 versions() fix Command Injection issue (linux), added smartmontools support (macOS) 2026-02-15 09:08:35 +01:00
Sebastian Hildebrandt
5a534cd62a 5.31.0 2026-02-15 09:01:23 +01:00
Sebastian Hildebrandt
b67d3715ee versions() fix Command Injection issue (linux), added smartmontools support (macOS) 2026-02-15 09:00:12 +01:00
Sebastian Hildebrandt
612d97e890 5.30.8 2026-02-14 11:09:13 +01:00
Sebastian Hildebrandt
22242aa561 wifiNetworks() fixed CWE-78 command injection issue (linux) 2026-02-14 11:09:05 +01:00
Sebastian Hildebrandt
41c7ea4ff8 5.30.7 2026-01-31 16:20:13 +01:00
Sebastian Hildebrandt
f4ff1d9faa networkInterfaces() fixed getWindowsIEEE8021x issue (windows) 2026-01-31 16:20:05 +01:00
12 changed files with 176 additions and 51 deletions

View File

@ -56,6 +56,7 @@ and adapt your own code to be again compatible to the new version 5.
- `disksIO()` added wait time (linux) - `disksIO()` added wait time (linux)
- `diskLayout()`: added USB drives (macOS) - `diskLayout()`: added USB drives (macOS)
- `diskLayout()`: added S.M.R.R.T. (win) - `diskLayout()`: added S.M.R.R.T. (win)
- `diskLayout()`: added S.M.R.R.T. (macOS)
- `fsSize()`: added available - `fsSize()`: added available
- `fsSize()`: improved calculation of used - `fsSize()`: improved calculation of used
- `getData()`: support for passing parameters and filters (see section General / - `getData()`: support for passing parameters and filters (see section General /
@ -90,6 +91,10 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| Version | Date | Comment | | Version | Date | Comment |
| ------- | ---------- | --------------------------------------------------------------------------------------------------- | | ------- | ---------- | --------------------------------------------------------------------------------------------------- |
| 5.31.1 | 2026-02-17 | `docs` updated (security advisory) |
| 5.31.0 | 2026-02-15 | `diskLayout()` added smartmontools support (macOS), `versions()` command injection issue (linux) |
| 5.30.8 | 2026-02-14 | `wifiNetworks()` fixed CWE-78 command injection issue (linux) |
| 5.30.7 | 2026-01-31 | `networkInterfaces()` fixed getWindowsIEEE8021x issue (windows) |
| 5.30.6 | 2026-01-22 | `graphics()` improved nvidia-smi detection (windows) | | 5.30.6 | 2026-01-22 | `graphics()` improved nvidia-smi detection (windows) |
| 5.30.5 | 2026-01-16 | `networkInterfaces()` fix uppercase iface names (linux) | | 5.30.5 | 2026-01-16 | `networkInterfaces()` fix uppercase iface names (linux) |
| 5.30.4 | 2026-01-15 | `powerShell()` fix UTF8 output (windows) | | 5.30.4 | 2026-01-15 | `powerShell()` fix UTF8 output (windows) |
@ -533,7 +538,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| 4.18.3 | 2020-01-10 | `fsSize()` fix excluding loop/snap devices | | 4.18.3 | 2020-01-10 | `fsSize()` fix excluding loop/snap devices |
| 4.18.2 | 2020-01-10 | `memLayout()` fix memsize linux (modules >= 32 GB) | | 4.18.2 | 2020-01-10 | `memLayout()` fix memsize linux (modules >= 32 GB) |
| 4.18.1 | 2020-01-07 | updated docs | | 4.18.1 | 2020-01-07 | updated docs |
| 4.18.0 | 2020-01-07 | `networkInterfaces()` added dhcp for mac os, added dhcp linux fallback | | 4.18.0 | 2020-01-07 | `networkInterfaces()` added dhcp for macOS, added dhcp linux fallback |
| 4.17.3 | 2020-01-05 | code cleanup | | 4.17.3 | 2020-01-05 | code cleanup |
| 4.17.2 | 2020-01-05 | `cpu().speed` AMD base frequency and fix (0.00) | | 4.17.2 | 2020-01-05 | `cpu().speed` AMD base frequency and fix (0.00) |
| 4.17.1 | 2020-01-04 | `fsSize()` alpine linux support | | 4.17.1 | 2020-01-04 | `fsSize()` alpine linux support |

View File

@ -31,7 +31,7 @@
## The Systeminformation Project ## The Systeminformation Project
This is amazing. Started as a small project just for myself, it now has > 19,000 This is amazing. Started as a small project just for myself, it now has > 19,000
lines of code, > 700 versions published, up to 15 mio downloads per month, > 450 lines of code, > 700 versions published, up to 20 mio downloads per month, > 480
mio downloads overall. Top 10 NPM ranking for backend packages. Thank you to all mio downloads overall. Top 10 NPM ranking for backend packages. Thank you to all
who contributed to this project! who contributed to this project!
@ -539,8 +539,8 @@ Full function reference with examples can be found at
| | [0].serialNum | X | | X | X | | serial number | | | [0].serialNum | X | | X | X | | serial number |
| | [0].interfaceType | X | | X | X | | SATA, PCIe, ... | | | [0].interfaceType | X | | X | X | | SATA, PCIe, ... |
| | [0].smartStatus | X | | X | X | | S.M.A.R.T Status (see Known Issues) | | | [0].smartStatus | X | | X | X | | S.M.A.R.T Status (see Known Issues) |
| | [0].temperature | X | | | | | S.M.A.R.T temperature | | | [0].temperature | X | | X | X | | S.M.A.R.T temperature |
| | [0].smartData | X | | | X | | full S.M.A.R.T data from smartctl<br>requires at least smartmontools 7.0 | | | [0].smartData | X | | X | X | | full S.M.A.R.T data from smartctl<br>requires at least smartmontools 7.0 |
| si.blockDevices(cb) | [{...}] | X | | X | X | | returns array of disks, partitions,<br>raids and roms | | si.blockDevices(cb) | [{...}] | X | | X | X | | returns array of disks, partitions,<br>raids and roms |
| | [0].name | X | | X | X | | name | | | [0].name | X | | X | X | | name |
| | [0].type | X | | X | X | | type | | | [0].type | X | | X | X | | type |

View File

@ -242,8 +242,8 @@
<td>[0].temperature</td> <td>[0].temperature</td>
<td>X</td> <td>X</td>
<td></td> <td></td>
<td></td> <td>X</td>
<td></td> <td>X</td>
<td></td> <td></td>
<td>S.M.A.R.T temperature (if available)</td> <td>S.M.A.R.T temperature (if available)</td>
</tr> </tr>
@ -252,7 +252,7 @@
<td>[0].smartData</td> <td>[0].smartData</td>
<td>X</td> <td>X</td>
<td></td> <td></td>
<td></td> <td>X</td>
<td>X</td> <td>X</td>
<td></td> <td></td>
<td>full S.M.A.R.T data from smartctl<br>requires at least smartmontools 7.0<br>(see Known Issues)</td> <td>full S.M.A.R.T data from smartctl<br>requires at least smartmontools 7.0<br>(see Known Issues)</td>

View File

@ -57,6 +57,30 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr>
<th scope="row">5.31.1
</th>
<td>2026-02-17</td>
<td><span class="code">docs</span> updated (security advisory)</td>
</tr>
<tr>
<th scope="row">5.31.0
</th>
<td>2026-02-15</td>
<td><span class="code">diskLayout()</span> added smartmontools support (macOS), <span class="code">versions()</span> fix command injection</td>
</tr>
<tr>
<th scope="row">5.30.8
</th>
<td>2026-02-14</td>
<td><span class="code">wifiNetworks()</span> fixed CWE-78 command injection issue (linux)</td>
</tr>
<tr>
<th scope="row">5.30.7
</th>
<td>2026-01-31</td>
<td><span class="code">networkInterfaces()</span> fixed getWindowsIEEE8021x issue (windows)</td>
</tr>
<tr> <tr>
<th scope="row">5.30.6 <th scope="row">5.30.6
</th> </th>

View File

@ -166,11 +166,11 @@
<body> <body>
<header class="bg-image-full"> <header class="bg-image-full">
<div class="top-container"> <div class="top-container">
<a href="security.html" class="recommendation">Security advisory:<br>Update to v5.27.14</a> <a href="security.html" class="recommendation">Security advisory:<br>Update to v5.31.1</a>
<img class="logo" src="assets/logo.png" alt="logo"> <img class="logo" src="assets/logo.png" alt="logo">
<div class="title">systeminformation</div> <div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span>&nbsp;</div> <div class="subtitle"><span id="typed"></span>&nbsp;</div>
<div class="version">New Version: <span id="version">5.30.6</span></div> <div class="version">New Version: <span id="version">5.31.0</span></div>
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button> <button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
</div> </div>
<div class="down"> <div class="down">
@ -212,7 +212,7 @@
<div class="title">Downloads last month</div> <div class="title">Downloads last month</div>
</div> </div>
<div class="col-xl-4 col-lg-4 col-md-4 col-12"> <div class="col-xl-4 col-lg-4 col-md-4 col-12">
<div class="numbers">941</div> <div class="numbers">977</div>
<div class="title">Dependents</div> <div class="title">Dependents</div>
</div> </div>
</div> </div>

View File

@ -73,10 +73,14 @@
<p><span class="code">node.js</span> and <span class="code">get-WmiObject</span> are not able to determine correct CPU current speed on windows and macOS. <p><span class="code">node.js</span> and <span class="code">get-WmiObject</span> are not able to determine correct CPU current speed on windows and macOS.
This means, you will have constant values here on both platforms for all processor cores in <span class="code">cpuCurrentSpeed()</span>.</p> This means, you will have constant values here on both platforms for all processor cores in <span class="code">cpuCurrentSpeed()</span>.</p>
<h4>Linux S.M.A.R.T. Status</h4> <h4>Linux, Windows, macOS - S.M.A.R.T. Status</h4>
<p>To be able to detect S.M.A.R.T. status on Linux you need to install <span class="code">smartmontools</span>. On DEBIAN based linux distributions you can install it by running:</p> <p>To be able to detect S.M.A.R.T. status on macOS, Windows and Linux you need to install <span class="code">smartmontools</span>.</p>
<p>On DEBIAN based linux distributions you can install it by running:</p>
<pre>$ sudo apt-get install smartmontools</pre> <pre>$ sudo apt-get install smartmontools</pre>
<p>On macOS you can install it using <span class="code">brew</span>:</p>
<pre>$ brew install smartmontools</pre>
<p>On windows you can download it from <a href="https://www.smartmontools.org/">https://www.smartmontools.org/</a></p>
<p>If you have smartmontools version >= 7.0 then you will get also full smart data in diskLayout()</p> <p>If you have smartmontools version >= 7.0 then you will get also full smart data in diskLayout()</p>
<h4>Stats Functions</h4> <h4>Stats Functions</h4>

View File

@ -44,6 +44,36 @@
<div class="col-12 sectionheader"> <div class="col-12 sectionheader">
<div class="title">Security Advisories</div> <div class="title">Security Advisories</div>
<div class="text"> <div class="text">
<h2>versions() Command Injection Vulnerability</h2>
<p><span class="bold">Affected versions:</span>
&lt; 5.31.0<br>
<span class="bold">Date:</span> 2026-02-15<br>
<span class="bold">CVE indentifier</span> CVE-2026-26318
</p>
<h4>Impact</h4>
<p>We had an issue that there was a possibility to perform a potential command injection possibility by craft the malicious file path for postgres that is then used in <span class="code">versions()</span> on linux machines.</p>
<h4>Patch</h4>
<p>Problem was fixed with parameter checking and execFile. If you are using version 5, please upgrade to version >= 5.31.0.</p>
<hr>
<br>
<h2>wifiNetworks Command Injection Vulnerability</h2>
<p><span class="bold">Affected versions:</span>
&lt; 5.30.8<br>
<span class="bold">Date:</span> 2026-02-14<br>
<span class="bold">CVE indentifier</span> CVE-2026-26280
</p>
<h4>Impact</h4>
<p>We had an issue that there was a possibility to perform a potential command injection possibility by manipulating SSIDs in <span class="code">wifiNetworks()</span> on linux machines.</p>
<h4>Patch</h4>
<p>Problem was fixed with parameter checking. If you are using version 5, please upgrade to version >= 5.30.8.</p>
<hr>
<br>
<h2>fsSize Command Injection Vulnerability</h2> <h2>fsSize Command Injection Vulnerability</h2>
<p><span class="bold">Affected versions:</span> <p><span class="bold">Affected versions:</span>
&lt; 5.27.14<br> &lt; 5.27.14<br>
@ -58,7 +88,6 @@
<p>Problem was fixed with parameter checking. If you are using version 5, please upgrade to version >= 5.27.14.</p> <p>Problem was fixed with parameter checking. If you are using version 5, please upgrade to version >= 5.27.14.</p>
<hr> <hr>
<br> <br>
<h2>SSID Command Injection Vulnerability</h2> <h2>SSID Command Injection Vulnerability</h2>
<p><span class="bold">Affected versions:</span> <p><span class="bold">Affected versions:</span>
&lt; 5.23.7<br> &lt; 5.23.7<br>

View File

@ -1349,6 +1349,7 @@ function diskLayout(callback) {
resolve(result); resolve(result);
} }
if (_darwin) { if (_darwin) {
let cmdFullSmart = '';
exec('system_profiler SPSerialATADataType SPNVMeDataType SPUSBDataType', { maxBuffer: 1024 * 1024 }, (error, stdout) => { exec('system_profiler SPSerialATADataType SPNVMeDataType SPUSBDataType', { maxBuffer: 1024 * 1024 }, (error, stdout) => {
if (!error) { if (!error) {
// split by type: // split by type:
@ -1420,6 +1421,7 @@ function diskLayout(callback) {
BSDName: BSDName BSDName: BSDName
}); });
cmd = cmd + 'printf "\n' + BSDName + '|"; diskutil info /dev/' + BSDName + ' | grep SMART;'; cmd = cmd + 'printf "\n' + BSDName + '|"; diskutil info /dev/' + BSDName + ' | grep SMART;';
cmdFullSmart += `${cmdFullSmart ? 'printf ",";' : ''}smartctl -a -j ${BSDName};`;
} }
} }
}); });
@ -1475,6 +1477,7 @@ function diskLayout(callback) {
BSDName: BSDName BSDName: BSDName
}); });
cmd = `${cmd}printf "\n${BSDName}|"; diskutil info /dev/${BSDName} | grep SMART;`; cmd = `${cmd}printf "\n${BSDName}|"; diskutil info /dev/${BSDName} | grep SMART;`;
cmdFullSmart += `${cmdFullSmart ? 'printf ",";' : ''}smartctl -a -j ${BSDName};`;
} }
} }
}); });
@ -1527,13 +1530,64 @@ function diskLayout(callback) {
BSDName: BSDName BSDName: BSDName
}); });
cmd = cmd + 'printf "\n' + BSDName + '|"; diskutil info /dev/' + BSDName + ' | grep SMART;'; cmd = cmd + 'printf "\n' + BSDName + '|"; diskutil info /dev/' + BSDName + ' | grep SMART;';
cmdFullSmart += `${cmdFullSmart ? 'printf ",";' : ''}smartctl -a -j ${BSDName};`;
} }
} }
}); });
} catch { } catch {
util.noop(); util.noop();
} }
// check S.M.A.R.T. status
if (cmdFullSmart) {
exec(cmdFullSmart, { maxBuffer: 1024 * 1024 }, (error, stdout) => {
try {
const data = JSON.parse(`[${stdout}]`);
data.forEach((disk) => {
const diskBSDName = disk.smartctl.argv[disk.smartctl.argv.length - 1];
for (let i = 0; i < result.length; i++) {
if (result[i].BSDName === diskBSDName) {
result[i].smartStatus = disk.smart_status.passed ? 'Ok' : disk.smart_status.passed === false ? 'Predicted Failure' : 'unknown';
if (disk.temperature && disk.temperature.current) {
result[i].temperature = disk.temperature.current;
}
result[i].smartData = disk;
}
}
});
commitResult(result);
} catch (e) {
if (cmd) { if (cmd) {
cmd = cmd + 'printf "\n"';
exec(cmd, { maxBuffer: 1024 * 1024 }, (error, stdout) => {
const lines = stdout.toString().split('\n');
lines.forEach((line) => {
if (line) {
const parts = line.split('|');
if (parts.length === 2) {
const BSDName = parts[0];
parts[1] = parts[1].trim();
const parts2 = parts[1].split(':');
if (parts2.length === 2) {
parts2[1] = parts2[1].trim();
const status = parts2[1].toLowerCase();
for (let i = 0; i < result.length; i++) {
if (result[i].BSDName === BSDName) {
result[i].smartStatus = status === 'passed' ? 'Ok' : status === 'failed!' ? 'Predicted Failure' : 'unknown';
}
}
}
}
}
});
commitResult(result);
});
} else {
commitResult(result);
}
}
});
} else if (cmd) {
cmd = cmd + 'printf "\n"'; cmd = cmd + 'printf "\n"';
exec(cmd, { maxBuffer: 1024 * 1024 }, (error, stdout) => { exec(cmd, { maxBuffer: 1024 * 1024 }, (error, stdout) => {
const lines = stdout.toString().split('\n'); const lines = stdout.toString().split('\n');

View File

@ -434,7 +434,7 @@ function getWindowsIEEE8021x(connectionType, iface, ifaces) {
i8021x.state = i8021xState.split(':').pop(); i8021x.state = i8021xState.split(':').pop();
i8021x.protocol = i8021xProtocol.split(':').pop(); i8021x.protocol = i8021xProtocol.split(':').pop();
} }
} catch { } catch (error) {
if (error.status === 1 && error.stdout.includes('AutoConfig')) { if (error.status === 1 && error.stdout.includes('AutoConfig')) {
i8021x.state = 'Disabled'; i8021x.state = 'Disabled';
i8021x.protocol = 'Not defined'; i8021x.protocol = 'Not defined';

View File

@ -228,6 +228,7 @@ function osInfo(callback) {
distro: 'unknown', distro: 'unknown',
release: 'unknown', release: 'unknown',
codename: '', codename: '',
domain: '',
kernel: os.release(), kernel: os.release(),
arch: os.arch(), arch: os.arch(),
hostname: os.hostname(), hostname: os.hostname(),
@ -364,6 +365,7 @@ function osInfo(callback) {
workload.push(util.powerShell('(Get-CimInstance Win32_ComputerSystem).HypervisorPresent')); workload.push(util.powerShell('(Get-CimInstance Win32_ComputerSystem).HypervisorPresent'));
workload.push(util.powerShell('Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SystemInformation]::TerminalServerSession')); workload.push(util.powerShell('Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SystemInformation]::TerminalServerSession'));
workload.push(util.powerShell('reg query "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" /v DisplayVersion')); workload.push(util.powerShell('reg query "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" /v DisplayVersion'));
workload.push(util.powerShell('Get-CimInstance Win32_ComputerSystem | select Domain | fl '));
util.promiseAll(workload).then((data) => { util.promiseAll(workload).then((data) => {
const lines = data.results[0] ? data.results[0].toString().split('\r\n') : ['']; const lines = data.results[0] ? data.results[0].toString().split('\r\n') : [''];
result.distro = util.getValue(lines, 'Caption', ':').trim(); result.distro = util.getValue(lines, 'Caption', ':').trim();
@ -378,6 +380,8 @@ function osInfo(callback) {
const codenameParts = data.results[3].split('REG_SZ'); const codenameParts = data.results[3].split('REG_SZ');
result.codename = codenameParts.length > 1 ? codenameParts[1].trim() : ''; result.codename = codenameParts.length > 1 ? codenameParts[1].trim() : '';
} }
const domain = data.results[4] ? data.results[4].toString().split('\r\n') : [''];
result.domain = util.getValue(domain, 'Domain', ':').trim();
if (!result.codename) { if (!result.codename) {
const buildNum = parseInt(result.build, 10); const buildNum = parseInt(result.build, 10);
result.codename = getWindowsRelease(buildNum); result.codename = getWindowsRelease(buildNum);
@ -769,9 +773,14 @@ function versions(apps, callback) {
if (_linux) { if (_linux) {
exec('locate bin/postgres', (error, stdout) => { exec('locate bin/postgres', (error, stdout) => {
if (!error) { if (!error) {
const postgresqlBin = stdout.toString().split('\n').sort(); const safePath = /^[a-zA-Z0-9/_.-]+$/;
const postgresqlBin = stdout
.toString()
.split('\n')
.filter((p) => safePath.test(p.trim()))
.sort();
if (postgresqlBin.length) { if (postgresqlBin.length) {
exec(postgresqlBin[postgresqlBin.length - 1] + ' -V', (error, stdout) => { execFile(postgresqlBin[postgresqlBin.length - 1], ['-V'], (error, stdout) => {
if (!error) { if (!error) {
const postgresql = stdout.toString().split('\n')[0].split(' ') || []; const postgresql = stdout.toString().split('\n')[0].split(' ') || [];
appsObj.versions.postgresql = postgresql.length ? postgresql[postgresql.length - 1] : ''; appsObj.versions.postgresql = postgresql.length ? postgresql[postgresql.length - 1] : '';

View File

@ -437,8 +437,8 @@ function wifiNetworks(callback) {
const res = getWifiNetworkListIw(ifaceSanitized); const res = getWifiNetworkListIw(ifaceSanitized);
if (res === -1) { if (res === -1) {
// try again after 4 secs // try again after 4 secs
setTimeout((iface) => { setTimeout(() => {
const res = getWifiNetworkListIw(iface); const res = getWifiNetworkListIw(ifaceSanitized);
if (res !== -1) { if (res !== -1) {
result = res; result = res;
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "systeminformation", "name": "systeminformation",
"version": "5.30.6", "version": "5.31.1",
"description": "Advanced, lightweight system and OS information library", "description": "Advanced, lightweight system and OS information library",
"license": "MIT", "license": "MIT",
"author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)", "author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",