diff --git a/CHANGELOG.md b/CHANGELOG.md index 77d2cb8..2e29cc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,7 +72,8 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | -| 5.3.1 | 2020-02-14 | `inetLatency()` `ineChecksite()` `servcices()` `processes()` fixed possible security issue | +| 5.3.2 | 2020-02-15 | `inetLatency()` `ineChecksite()` fixed possible security issue (file://) | +| 5.3.1 | 2020-02-14 | `inetLatency()` `ineChecksite()` `servcices()` `processes()` fixed possible security issue (arrays) | | 5.3.0 | 2020-02-12 | `osInfo()` added remoteSession (windows) | | 5.2.7 | 2020-02-12 | `fsStats()`, `blockDevices()` improved linux | | 5.2.6 | 2020-02-12 | `inetLatency()` fixed possible DOS intrusion | diff --git a/docs/history.html b/docs/history.html index 189f3c2..be9c2b9 100644 --- a/docs/history.html +++ b/docs/history.html @@ -56,6 +56,11 @@ + + 5.3.2 + 2020-02-15 + inetLatency() inetChecksite() fix possible security issue (file://) + 5.3.1 2020-02-14 diff --git a/docs/index.html b/docs/index.html index ab758b6..c7b61a5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -166,11 +166,11 @@
- Security advisory:
Update to v5.3.1
+ Security advisory:
Update to v5.3.2
systeminformation
 
-
New Version: 5.3.1
+
New Version: 5.3.2
@@ -201,7 +201,7 @@
-
13,752
+
13,833
Lines of code
@@ -209,7 +209,7 @@
Downloads last month
-
382
+
387
Dependents
diff --git a/docs/security.html b/docs/security.html index 316e63f..0f23f85 100644 --- a/docs/security.html +++ b/docs/security.html @@ -43,6 +43,23 @@
Security Advisories
+

Insufficient File Scheme Validation

+

Affected versions: + < 5.3.2 and < 4.34.12
+ Date: 2021-02-15
+ CVE indentifier - +

+ +

Impact

+

We had an issue that there was a possibility to run inetChecksite against local files due to improper file scheme validation. Affected commands: inetLatency(), inetChecksite().

+ +

Patch

+

Problem was fixed with additional parameter checking. Please upgrade to version >= 5.3.2 (or >= 4.34.12 if you are using version 4).

+ +

Workarround

+

If you cannot upgrade, be sure to check or sanitize service parameter strings that are passed to inetLatency(), inetChecksite() (sanitize `file://` parameter)

+
+

Command Injection Vulnerability

Affected versions: < 5.3.1 and < 4.34.11
diff --git a/docs/v4/gettingstarted.html b/docs/v4/gettingstarted.html index bf6afff..a97048f 100644 --- a/docs/v4/gettingstarted.html +++ b/docs/v4/gettingstarted.html @@ -67,7 +67,7 @@

This library is supposed to be used as a node.js backend/server-side library and will definilely not work within a browser.

Installation (old version 4)

-
$ npm install systeminformation@4 —save
+
$ npm install systeminformation@4 —-save

Usage

All functions (except version and time) are implemented as asynchronous functions. Here a small example how to use them:

const si = require('systeminformation');
diff --git a/docs/v4/history.html b/docs/v4/history.html
index b3fddef..a933e98 100644
--- a/docs/v4/history.html
+++ b/docs/v4/history.html
@@ -83,6 +83,11 @@
                   
                 
                 
+                  
+                    4.34.12
+                    2020-02-15
+                    inetLatency() inetChecksite() fix possible security issue (file://)
+                  
                   
                     4.34.11
                     2020-02-14
diff --git a/docs/v4/index.html b/docs/v4/index.html
index 79d618e..6423484 100644
--- a/docs/v4/index.html
+++ b/docs/v4/index.html
@@ -170,7 +170,7 @@
       
systeminformation
 
Version 4 documentation
-
Current Version: 4.34.11
+
Current Version: 4.34.12
diff --git a/docs/v4/security.html b/docs/v4/security.html index 2fcbfdb..78d966d 100644 --- a/docs/v4/security.html +++ b/docs/v4/security.html @@ -42,6 +42,23 @@
Security Advisories
+

Insufficient File Scheme Validation

+

Affected versions: + 4.34.12
+ Date: 2021-02-15
+ CVE indentifier - +

+ +

Impact

+

We had an issue that there was a possibility to run inetChecksite against local files due to improper file scheme validation. Affected commands: inetLatency(), inetChecksite().

+ +

Patch

+

Problem was fixed with additional parameter checking. Please upgrade to version >= 4.34.12 if you are using version 4.

+ +

Workarround

+

If you cannot upgrade, be sure to check or sanitize service parameter strings that are passed to inetLatency(), inetChecksite() (sanitize `file://` parameter)

+
+

Command Injection Vulnerability

Affected versions: < 4.34.11
diff --git a/lib/internet.js b/lib/internet.js index c71f80d..6c4e9af 100644 --- a/lib/internet.js +++ b/lib/internet.js @@ -58,6 +58,11 @@ function inetChecksite(url, callback) { result.url = urlSanitized; try { if (urlSanitized && !util.isPrototypePolluted()) { + urlSanitized.__proto__.startsWith = util.stringStartWith; + if (urlSanitized.startsWith('file:')) { + if (callback) { callback(result); } + return resolve(result); + } let t = Date.now(); if (_linux || _freebsd || _openbsd || _netbsd || _darwin || _sunos) { let args = ' -I --connect-timeout 5 -m 5 ' + urlSanitized + ' 2>/dev/null | head -n 1 | cut -d " " -f2'; @@ -146,6 +151,11 @@ function inetLatency(host, callback) { } } } + hostSanitized.__proto__.startsWith = util.stringStartWith; + if (hostSanitized.startsWith('file:')) { + if (callback) { callback(null); } + return resolve(null); + } let params; let filt; if (_linux || _freebsd || _openbsd || _netbsd || _darwin) { diff --git a/lib/util.js b/lib/util.js index dd94ba2..56b80d2 100644 --- a/lib/util.js +++ b/lib/util.js @@ -57,6 +57,7 @@ const stringToLower = new String().toLowerCase; const stringToString = new String().toString; const stringSubstr = new String().substr; const stringTrim = new String().trim; +const stringStartWith = new String().startsWith; function isFunction(functionToCheck) { let getType = {}; @@ -939,5 +940,6 @@ exports.stringToLower = stringToLower; exports.stringToString = stringToString; exports.stringSubstr = stringSubstr; exports.stringTrim = stringTrim; +exports.stringStartWith = stringStartWith; exports.WINDIR = WINDIR; exports.getFilesInPath = getFilesInPath;