CVE-2020-26245 (JavaScript, published 2020-11-27T20:15Z)
Description: value: npm package systeminformation before version 4.30.5 is vulnerable to Prototype Pollution leading to Command Injection. The issue was fixed with a rewrite of shell sanitations to avoid prototyper pollution problems. The issue is fixed in version 4.30.5. If you cannot upgrade, be sure to check or sanitize service parameter strings that are passed to si.inetChecksite().
Severity: HIGH (CVSS v3 base score: 9.8)
Weakness: CWE-78 \u2014 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
Repository: https://github.com/sebhildebrandt/systeminformation
Files changed:
CHANGELOG.md
docs/history.html
docs/index.html
lib/index.js
lib/internet.js
lib/network.js
lib/processes.js
lib/util.js
Commit message: adapted security update (prototype pollution prevention)


Vulnerable code:
      <div class="version">Current Version: <span id="version">4.30.4</span></div>
// Object.freeze(String.prototype);
// Object.freeze(Object.prototype);


      const ifaceSanitized = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface);
        let srvString = util.sanitizeShellString(srv);

Fixed code:
| 4.30.5         | 2020-11-26     | adapted security update (prototype pollution prevention) |
                  <tr>
                    <th scope="row">4.30.5</th>
                    <td>2020-11-26</td>
                    <td>adapted security update (prototype pollution prevention)</td>
                  </tr>
      <div class="version">Current Version: <span id="version">4.30.5</span></div>
          s[i].__proto__.toLowerCase = util.stringToLower;
      let ifaceSanitized = '';
      const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface);
      for (let i = 0; i <= 2000; i++) {
        if (!(s[i] === undefined)) {
          ifaceSanitized = ifaceSanitized + s[i];
        }
      }
        let srvString = '';
        srvString.__proto__.toLowerCase = util.stringToLower;
        srvString.__proto__.replace = util.stringReplace;
        srvString.__proto__.trim = util.stringTrim;

        const s = util.sanitizeShellString(srv);
        for (let i = 0; i <= 2000; i++) {
          if (!(s[i] === undefined)) {
            srvString = srvString + s[i];
          }
        }


const stringReplace = new String().replace;
const stringToLower = new String().toLowerCase;
const stringToString = new String().toString;
const stringSubstr = new String().substr;
const stringTrim = new String().trim;


  st.__proto__.replace = stringReplace;
  st.__proto__.toLowerCase = stringToLower;
  st.__proto__.toString = stringToString;
  st.__proto__.substr = stringSubstr;

    stm.__proto__.replace = stringReplace;
      s1.__proto__.toLowerCase = stringToLower;
exports.stringReplace = stringReplace;
exports.stringToLower = stringToLower;
exports.stringToString = stringToString;
exports.stringSubstr = stringSubstr;
exports.stringTrim = stringTrim;