systeminformation 5.33.13 → 5.33.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/graphics.js CHANGED
@@ -228,7 +228,7 @@ function graphics(callback) {
228
228
  // PCI bus IDs
229
229
  let pciIDs = [];
230
230
  try {
231
- pciIDs = execSync('export LC_ALL=C; dmidecode -t 9 2>/dev/null; unset LC_ALL | grep "Bus Address: "', util.execOptsLinux).toString().split('\n');
231
+ pciIDs = execSync('export LC_ALL=C; dmidecode -t 9 2>/dev/null | grep "Bus Address: "', util.execOptsLinux).toString().split('\n');
232
232
  for (let i = 0; i < pciIDs.length; i++) {
233
233
  pciIDs[i] = pciIDs[i].replace('Bus Address:', '').replace('0000:', '').trim();
234
234
  }
package/lib/network.js CHANGED
@@ -1360,6 +1360,13 @@ function networkStatsSingle(iface) {
1360
1360
  ms: 0
1361
1361
  };
1362
1362
 
1363
+ // an interface name never starts with a dash - passed on to ifconfig / netstat it would be
1364
+ // read as an option instead of as an interface name (index access, so a polluted
1365
+ // String.prototype cannot bypass it)
1366
+ if (ifaceSanitized[0] === '-') {
1367
+ return resolve(result);
1368
+ }
1369
+
1363
1370
  let operstate = 'unknown';
1364
1371
  let rx_bytes = 0;
1365
1372
  let tx_bytes = 0;
@@ -1375,7 +1382,9 @@ function networkStatsSingle(iface) {
1375
1382
  (_network[ifaceSanitized] && _network[ifaceSanitized].ms && Date.now() - _network[ifaceSanitized].ms >= 500)
1376
1383
  ) {
1377
1384
  if (_linux) {
1378
- if (fs.existsSync('/sys/class/net/' + ifaceSanitized)) {
1385
+ // interface name must stay a single path segment inside /sys/class/net (no traversal)
1386
+ const ifaceIsSegment = ifaceSanitized !== '' && ifaceSanitized !== '.' && ifaceSanitized !== '..' && ifaceSanitized.split('').every((c) => c !== '/');
1387
+ if (ifaceIsSegment && fs.existsSync('/sys/class/net/' + ifaceSanitized)) {
1379
1388
  cmd =
1380
1389
  'cat /sys/class/net/' +
1381
1390
  ifaceSanitized +
package/lib/users.js CHANGED
@@ -175,7 +175,7 @@ function users(callback) {
175
175
 
176
176
  // linux
177
177
  if (_linux) {
178
- exec('export LC_ALL=C; who --ips; echo "---"; w; unset LC_ALL | tail -n +2', (error, stdout) => {
178
+ exec('export LC_ALL=C; who --ips; echo "---"; w | tail -n +2', (error, stdout) => {
179
179
  if (!error) {
180
180
  // lines / split
181
181
  let lines = stdout.toString().split('\n');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.33.13",
3
+ "version": "5.33.14",
4
4
  "description": "Advanced, lightweight system and OS information library",
5
5
  "license": "MIT",
6
6
  "author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",