SSID Command Injection Vulnerability
+Affected versions:
+ < 5.23.7
+ Date: 2024-11-11
+ CVE indentifier CVE-2024-56334
+
Impact
+We had an issue that there was a possibility to perform a potential command injection possibility by crafting detected SSIDs in networkInterfaces() on windows machines.
+ +Patch
+Problem was fixed with parameter checking. If you are using version 5, please upgrade to version >= 5.23.7.
++
+
Passing User Paramters to Systeminformation
For most of the applications that are using systeminformation, there is no reason to worry. But be aware! If you are using inetLatency(), inetChecksite(), services(), processLoad(), versions() with arbitrary untrusted user input, you should pay extra attention! We are doing a lot of input sanitation for those functions inside this package but we cannot handle all cases!
This can lead to serious impact on your servers!
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 "systeminformation": "^4" in your package.json (dependencies) and run npm install
++
SSID Command Injection Vulnerability
Affected versions: diff --git a/lib/users.js b/lib/users.js index 8d877a2..e6ffc3b 100644 --- a/lib/users.js +++ b/lib/users.js @@ -120,7 +120,7 @@ function parseUsersDarwin(lines) { result_w.command = l.slice(5, 1000).join(' '); // find corresponding 'who' line who_line = result_who.filter(function (obj) { - return (obj.user === result_w.user && (obj.tty.substring(3, 1000) === result_w.tty || obj.tty === result_w.tty)); + return (obj.user.substring(0, 10) === result_w.user.substring(0, 10) && (obj.tty.substring(3, 1000) === result_w.tty || obj.tty === result_w.tty)); }); if (who_line.length === 1) { result.push({ diff --git a/lib/wifi.js b/lib/wifi.js index c287b14..72624c0 100644 --- a/lib/wifi.js +++ b/lib/wifi.js @@ -396,6 +396,47 @@ function parseWifiDarwin(wifiObj) { } return result; } + +function parseWifi2Darwin(wifiStr) { + const result = []; + try { + let wifiObj = JSON.parse(wifiStr); + wifiObj = wifiObj.SPAirPortDataType[0].spairport_airport_interfaces[0].spairport_airport_other_local_wireless_networks; + wifiObj.forEach(function (wifiItem) { + + let security = []; + const sm = wifiItem.spairport_security_mode; + if (sm === 'spairport_security_mode_wep') { + security.push('WEP'); + } else if (sm === 'spairport_security_mode_wpa2_personal') { + security.push('WPA2'); + } else if (sm.startsWith('spairport_security_mode_wpa2_enterprise')) { + security.push('WPA2 EAP'); + } else if (sm.startsWith('pairport_security_mode_wpa3_transition')) { + security.push('WPA2/WPA3'); + } else if (sm.startsWith('pairport_security_mode_wpa3')) { + security.push('WPA3'); + } + const channelInfo = new RegExp(/(\d+) \((\d)GHz, (\d+)MHz\)/g).exec(wifiItem.spairport_network_channel); + + result.push({ + ssid: wifiItem._name || '', + bssid: '', + mode: wifiItem.spairport_network_phymode, + channel: parseInt(channelInfo[0].split(' ')[0]), + frequency: wifiFrequencyFromChannel(channelInfo[1]), + signalLevel: null, + quality: null, + security, + wpaFlags: [], + rsnFlags: [] + }); + }); + return result; + } catch (e) { + return result; + } +}; function wifiNetworks(callback) { return new Promise((resolve) => { process.nextTick(() => { @@ -459,10 +500,15 @@ function wifiNetworks(callback) { resolve(result); } } else if (_darwin) { - let cmd = '/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s -x'; + let cmd = '/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s -x >2 /dev/bull; echo "######"; system_profiler -json SPAirPortDataType'; exec(cmd, { maxBuffer: 1024 * 40000 }, function (error, stdout) { const output = stdout.toString(); - result = parseWifiDarwin(util.plistParser(output)); + const parts = output.split('######'); + if (parts[0]) { + result = parseWifiDarwin(util.plistParser(parts[0])); + } else { + result = parseWifi2Darwin(parts[1]); + } if (callback) { callback(result); }