Skip to content

Commit b319280

Browse files
committed
Updated systeminformation with changes from master
2 parents 17fabda + 5a9fe24 commit b319280

File tree

14 files changed

+127
-31
lines changed

14 files changed

+127
-31
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
8383

8484
| Version | Date | Comment |
8585
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
86+
| 5.21.11 | 2023-10-05 | `osInfo()` fix getLogoFile (BSD) |
87+
| 5.21.10 | 2023-10-04 | `wifiNetworks()` improved parsing (macOS) |
88+
| 5.21.9 | 2023-09-25 | `general` code cleanup |
89+
| 5.21.8 | 2023-09-20 | `battery()` fixed parsing (linux) |
90+
| 5.21.7 | 2023-09-19 | `wifiConnections()` `wifiNetworks()` fixed security issue (linux) |
91+
| 5.21.6 | 2023-09-18 | `baseboard()` improved parsing (windows) |
8692
| 5.21.5 | 2023-09-15 | `chassis()`, `baseboard()` improved parsing (windows) |
8793
| 5.21.4 | 2023-09-02 | `wifiConnections()` fixed when no wifi chip (macOS) |
8894
| 5.21.3 | 2023-08-31 | `cpuTemperature()` improved parsing for AMD (linux) |

docs/history.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,36 @@ <h3>Full version history</h3>
5757
</tr>
5858
</thead>
5959
<tbody>
60+
<tr>
61+
<th scope="row">5.21.11</th>
62+
<td>2023-10-05</td>
63+
<td><span class="code">osInfo()</span> fix getLogoFile (BSD)</td>
64+
</tr>
65+
<tr>
66+
<th scope="row">5.21.10</th>
67+
<td>2023-10-04</td>
68+
<td><span class="code">wifiNetworks()</span> improved parsing (macOS)</td>
69+
</tr>
70+
<tr>
71+
<th scope="row">5.21.9</th>
72+
<td>2023-09-25</td>
73+
<td><span class="code">general</span> code cleanup</td>
74+
</tr>
75+
<tr>
76+
<th scope="row">5.21.8</th>
77+
<td>2023-09-20</td>
78+
<td><span class="code">battery()</span> fixed parsing (linux)</td>
79+
</tr>
80+
<tr>
81+
<th scope="row">5.21.7</th>
82+
<td>2023-09-19</td>
83+
<td><span class="code">wifiConnections()</span> <span class="code">wifiNetworks()</span>fixed security issue (linux)</td>
84+
</tr>
85+
<tr>
86+
<th scope="row">5.21.6</th>
87+
<td>2023-09-18</td>
88+
<td><span class="code">baseboard()</span> improved parsing (windows)</td>
89+
</tr>
6090
<tr>
6191
<th scope="row">5.21.5</th>
6292
<td>2023-09-15</td>

docs/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@
166166
<body>
167167
<header class="bg-image-full">
168168
<div class="top-container">
169-
<a href="security.html" class="recommendation">Security advisory:<br>Update to v5.6.13</a>
169+
<a href="security.html" class="recommendation">Security advisory:<br>Update to v5.21.7</a>
170170
<img class="logo" src="assets/logo.png" alt="logo">
171171
<div class="title">systeminformation</div>
172172
<div class="subtitle"><span id="typed"></span>&nbsp;</div>
173-
<div class="version">New Version: <span id="version">5.21.5</span></div>
173+
<div class="version">New Version: <span id="version">5.21.11</span></div>
174174
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
175175
</div>
176176
<div class="down">
@@ -204,15 +204,15 @@
204204
</div>
205205
<div class="row number-section">
206206
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
207-
<div class="numbers">15,642</div>
207+
<div class="numbers">15,727</div>
208208
<div class="title">Lines of code</div>
209209
</div>
210210
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
211211
<div id="downloads" class="numbers">...</div>
212212
<div class="title">Downloads last month</div>
213213
</div>
214214
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
215-
<div class="numbers">645</div>
215+
<div class="numbers">658</div>
216216
<div class="title">Dependents</div>
217217
</div>
218218
</div>

docs/security.html

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,24 @@ <h2>Passing User Paramters to Systeminformation</h2>
4949
<p class="warning">This can lead to serious impact on your servers!</p>
5050
<p>We highly recommend to always upgrade to the latest version of our package. We maintain security updates for version 5 AND also version 4. For version 4 you can install latest version by placing <span class="code">"systeminformation": "^4"</span> in your package.json (dependencies) and run <span class="code">npm install</span></p>
5151

52+
<h2>SSID Command Injection Vulnerability</h2>
53+
<p><span class="bold">Affected versions:</span>
54+
&lt; 5.21.07 (version 4 is not affected)<br>
55+
<span class="bold">Date:</span> 2023-09-19<br>
56+
<span class="bold">CVE indentifier</span> CVE-2023-42810
57+
</p>
58+
59+
<h4>Impact</h4>
60+
<p>We had an issue that there was a possibility to perform a potential command injection possibility by crafting detected SSIDs in <span class="code">wifiConnections()</span>, <span class="code">wifiNetworks()</span>.</p>
61+
62+
<h4>Patch</h4>
63+
<p>Problem was fixed with parameter checking. If you are using version 5, please upgrade to version >= 5.7.21 (version 4 is not affected).</p>
64+
65+
<h4>Workaround</h4>
66+
<p>If you cannot upgrade, be sure to check or sanitize parameter strings that are passed to <span class="code">wifiConnections()</span>, <span class="code">wifiNetworks()</span> (string only)</p>
67+
<hr>
68+
<br>
69+
5270
<h2>Command Injection Vulnerability</h2>
5371
<p><span class="bold">Affected versions:</span>
5472
&lt; 5.6.13 and &lt; 4.34.21<br>
@@ -255,4 +273,4 @@ <h4>Workaround</h4>
255273
</script>
256274
</body>
257275

258-
</html>
276+
</html>

lib/battery.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ module.exports = function (callback) {
127127
const energy = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_ENERGY_NOW', '='), 10);
128128
const power = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_POWER_NOW', '='), 10);
129129
const current = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_CURRENT_NOW', '='), 10);
130+
const charge = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_CHARGE_NOW', '='), 10);
130131

131132
result.percent = parseInt('0' + percent, 10);
132133
if (result.maxCapacity && result.currentCapacity) {
@@ -140,6 +141,8 @@ module.exports = function (callback) {
140141
}
141142
if (energy && power) {
142143
result.timeRemaining = Math.floor(energy / power * 60);
144+
} else if (current && charge) {
145+
result.timeRemaining = Math.floor(charge / current * 60);
143146
} else if (current && result.currentCapacity) {
144147
result.timeRemaining = Math.floor(result.currentCapacity / current * 60);
145148
}

lib/docker.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,8 @@ function dockerContainerStats(containerIDs, callback) {
462462
if (containerIDsSanitized !== '*') {
463463
containerIDsSanitized = '';
464464
const s = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(containerIDs, true)).trim();
465-
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
465+
const l = util.mathMin(s.length, 2000);
466+
for (let i = 0; i <= l; i++) {
466467
if (s[i] !== undefined) {
467468
s[i].__proto__.toLowerCase = util.stringToLower;
468469
const sl = s[i].toLowerCase();

lib/internet.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
// 12. Internet
1414
// ----------------------------------------------------------------------------------
1515

16-
// const exec = require('child_process').exec;
1716
const util = require('./util');
1817

1918
let _platform = process.platform;
@@ -45,7 +44,8 @@ function inetChecksite(url, callback) {
4544
}
4645
let urlSanitized = '';
4746
const s = util.sanitizeShellString(url, true);
48-
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
47+
const l = util.mathMin(s.length, 2000);
48+
for (let i = 0; i <= l; i++) {
4949
if (s[i] !== undefined) {
5050
s[i].__proto__.toLowerCase = util.stringToLower;
5151
const sl = s[i].toLowerCase();
@@ -143,7 +143,8 @@ function inetLatency(host, callback) {
143143
}
144144
let hostSanitized = '';
145145
const s = (util.isPrototypePolluted() ? '8.8.8.8' : util.sanitizeShellString(host, true)).trim();
146-
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
146+
const l = util.mathMin(s.length, 2000);
147+
for (let i = 0; i <= l; i++) {
147148
if (!(s[i] === undefined)) {
148149
s[i].__proto__.toLowerCase = util.stringToLower;
149150
const sl = s[i].toLowerCase();

lib/network.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,8 @@ function networkInterfaces(callback, rescan, defaultString) {
745745

746746
let ifaceSanitized = '';
747747
const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(nic.iface);
748-
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
748+
const l = util.mathMin(s.length, 2000);
749+
for (let i = 0; i <= l; i++) {
749750
if (s[i] !== undefined) {
750751
ifaceSanitized = ifaceSanitized + s[i];
751752
}
@@ -840,7 +841,8 @@ function networkInterfaces(callback, rescan, defaultString) {
840841
let iface = dev.split(':')[0].trim().toLowerCase();
841842
let ifaceSanitized = '';
842843
const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface);
843-
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
844+
const l = util.mathMin(s.length, 2000);
845+
for (let i = 0; i <= l; i++) {
844846
if (s[i] !== undefined) {
845847
ifaceSanitized = ifaceSanitized + s[i];
846848
}
@@ -973,7 +975,8 @@ function networkInterfaces(callback, rescan, defaultString) {
973975

974976
let ifaceSanitized = '';
975977
const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(dev);
976-
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
978+
const l = util.mathMin(s.length, 2000);
979+
for (let i = 0; i <= l; i++) {
977980
if (s[i] !== undefined) {
978981
ifaceSanitized = ifaceSanitized + s[i];
979982
}
@@ -1221,7 +1224,8 @@ function networkStatsSingle(iface) {
12211224
process.nextTick(() => {
12221225
let ifaceSanitized = '';
12231226
const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface);
1224-
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
1227+
const l = util.mathMin(s.length, 2000);
1228+
for (let i = 0; i <= l; i++) {
12251229
if (s[i] !== undefined) {
12261230
ifaceSanitized = ifaceSanitized + s[i];
12271231
}

lib/osinfo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ function osInfo(callback) {
272272
exec('sysctl kern.ostype kern.osrelease kern.osrevision kern.hostuuid machdep.bootmethod kern.geom.confxml', function (error, stdout) {
273273
let lines = stdout.toString().split('\n');
274274
const distro = util.getValue(lines, 'kern.ostype');
275-
const logofile = util.getLogoFile(distro);
275+
const logofile = getLogoFile(distro);
276276
const release = util.getValue(lines, 'kern.osrelease').split('-')[0];
277277
const serial = util.getValue(lines, 'kern.uuid');
278278
const bootmethod = util.getValue(lines, 'machdep.bootmethod');

lib/processes.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ function services(srv, callback) {
131131
srvString.__proto__.trim = util.stringTrim;
132132

133133
const s = util.sanitizeShellString(srv);
134-
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
134+
const l = util.mathMin(s.length, 2000);
135+
for (let i = 0; i <= l; i++) {
135136
if (s[i] !== undefined) {
136137
srvString = srvString + s[i];
137138
}
@@ -986,7 +987,9 @@ function processLoad(proc, callback) {
986987
processesString.__proto__.trim = util.stringTrim;
987988

988989
const s = util.sanitizeShellString(proc);
989-
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
990+
const l = util.mathMin(s.length, 2000);
991+
992+
for (let i = 0; i <= l; i++) {
990993
if (s[i] !== undefined) {
991994
processesString = processesString + s[i];
992995
}

0 commit comments

Comments
 (0)