-
Notifications
You must be signed in to change notification settings - Fork 1
fix(adhoc-sweep-fixes): CU-86akbhhdv 34 review findings across 27 files #149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
a344c39
3f8dd87
f28465b
2172f27
6663cc2
75ced05
aae040c
a7988ce
731abc1
52597e1
93cce24
9ee365c
37008de
7d55e8e
b8559d1
66b269e
c0d39a2
dddc888
7b8e2fa
de1c2ec
6da0570
58488f1
5724292
fe84804
91aa6ff
da24553
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,9 +85,9 @@ function DownloadAgentBinary(path, ID) | |
| { | ||
| var options = require('http').parseUri(require('MeshAgent').ServerInfo.ServerUri); | ||
| var downloadUri = 'https://' + options.host + ':' + options.port + '/meshagents?id=' + (ID != null ? ID : getARCHID()); | ||
| sendServerLog('Diagnostic: Attempting to downlod agent from: ' + downloadUri); | ||
| sendServerLog('Diagnostic: Attempting to download agent from: ' + downloadUri); | ||
|
|
||
| return (wget(downloadUri, path, { rejectUnauthorized: false })); | ||
| return (wget(downloadUri, path)); | ||
| } | ||
|
|
||
| function giveup() | ||
|
Comment on lines
85
to
93
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΅ Log message typo 'downlod' will pollute server diagnostic logs In π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
|
|
@@ -204,3 +204,4 @@ function start() | |
| } | ||
| } | ||
| }; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,7 +63,7 @@ function WsmanStackCreateService(/*CreateWsmanComm, host, port, user, pass, tls, | |
|
|
||
| // Perform a WSMAN Subscribe operation | ||
| obj.ExecSubscribe = function ExecSubscribe(resuri, delivery, url, callback, tag, pri, selectors, opaque, user, pass) { | ||
| var digest = "", digest2 = "", opaque = ""; | ||
| var digest = "", digest2 = ""; | ||
| if (user != null && pass != null) { digest = '<t:IssuedTokens xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust" xmlns:se="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><t:RequestSecurityTokenResponse><t:TokenType>http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken</t:TokenType><t:RequestedSecurityToken><se:UsernameToken><se:Username>' + user + '</se:Username><se:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#PasswordText">' + pass + '</se:Password></se:UsernameToken></t:RequestedSecurityToken></t:RequestSecurityTokenResponse></t:IssuedTokens>'; digest2 = '<w:Auth Profile="http://schemas.dmtf.org/wbem/wsman/1/wsman/secprofile/http/digest"/>'; } | ||
| if (opaque != null) { opaque = '<a:ReferenceParameters><m:arg>' + opaque + '</m:arg></a:ReferenceParameters>'; } | ||
| if (delivery == 'PushWithAck') { delivery = 'dmtf.org/wbem/wsman/1/wsman/PushWithAck'; } else if (delivery == 'Push') { delivery = 'xmlsoap.org/ws/2004/08/eventing/DeliveryModes/Push'; } | ||
|
Comment on lines
63
to
69
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π amt-wsman.js ExecSubscribe declares In π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -218,12 +218,13 @@ function macos_memUtilization() | |
| mem.MemTotal = (mem.MemFree + mem.MemUsed); | ||
| mem.percentFree = ((mem.MemFree / mem.MemTotal) * 100);//.toFixed(2); | ||
| mem.percentConsumed = (((mem.MemTotal - mem.MemFree) / mem.MemTotal) * 100);//.toFixed(2); | ||
| return (mem); | ||
| ret._res(mem); | ||
| } | ||
| else | ||
| { | ||
| throw ('Parse Error'); | ||
| ret._rej('Parse Error'); | ||
| } | ||
| return (ret); | ||
| } | ||
|
|
||
| function windows_thermals() | ||
|
Comment on lines
218
to
230
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΄ macos_thermals references undeclared global 'child' variable via implicit global leak In linux_thermals (agents/modules_meshcore/sysinfo.js), added π€ Prompt for AI agentsfix confidence: π’ 90 high β react π/π to teach the reviewer
Comment on lines
218
to
230
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π macos_memUtilization throws a plain string instead of an Error and never uses the promise it constructs In macos_memUtilization, changed the success path from (Automatically downgraded: no change in this fix lands near this finding's line β verify whether it was actually addressed.) π€ Prompt for AI agentsfix confidence: π΄ 40 low β review closely β react π/π to teach the reviewer |
||
|
|
@@ -243,7 +244,7 @@ function windows_thermals() | |
| function linux_thermals() | ||
| { | ||
| var ret = []; | ||
| child = require('child_process').execFile('/bin/sh', ['sh']); | ||
| var child = require('child_process').execFile('/bin/sh', ['sh']); | ||
| child.stdout.str = ''; child.stdout.on('data', function (c) { this.str += c.toString(); }); | ||
| child.stderr.str = ''; child.stderr.on('data', function (c) { this.str += c.toString(); }); | ||
| child.stdin.write("for folder in /sys/class/thermal/thermal_zone*/; do [ -e \"$folder/temp\" ] && echo \"$(cat \"$folder/temp\"),$(cat \"$folder/type\")\"; done\nexit\n"); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,7 +81,7 @@ function WiFiScanner() | |
| this.child.ms.on('end', function () | ||
| { | ||
| var str = this.buffer.toString(); | ||
| tokens = str.split(' - Address: '); | ||
| var tokens = str.split(' - Address: '); | ||
| for (var block in tokens) | ||
| { | ||
| if (block == 0) continue; | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π wifi-scanner.js leaks Changed π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,7 +104,7 @@ function sessionDispatch(tsid, parent, method, args) | |
| // | ||
| function background_get(tsid) | ||
| { | ||
| if (tsid != null || tsid === null) // TSID is not undefined or is explicitly null | ||
| if (tsid !== undefined) // TSID is not undefined | ||
| { | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΅ Tautological TSID guard duplicated across background_get/set and mousetrails_get/set Applied the identical fix ( π€ Prompt for AI agentsfix confidence: π‘ 80 medium β react π/π to teach the reviewer |
||
| // Need to disatch to different session first | ||
| return (sessionDispatch(tsid, 'background', 'get', [])); | ||
|
|
@@ -123,7 +123,7 @@ function background_get(tsid) | |
| // | ||
| function background_set(path, tsid) | ||
| { | ||
| if (tsid != null || tsid === null) // TSID is not undefined or is explicitly null | ||
| if (tsid !== undefined) // TSID is not undefined | ||
| { | ||
| // Need to disatch to different session first | ||
| return (sessionDispatch(tsid, 'background', 'set', [path])); | ||
|
|
@@ -160,7 +160,7 @@ function dispatch(parent, method, args) | |
| // | ||
| function mousetrails_set(value, tsid) | ||
| { | ||
| if (tsid != null || tsid === null) // TSID is not undefined or is explicitly null | ||
| if (tsid !== undefined) // TSID is not undefined | ||
| { | ||
| // Need to disatch to different session first | ||
| return (sessionDispatch(tsid, 'mouse', 'setTrails', [value])); | ||
|
|
@@ -178,7 +178,7 @@ function mousetrails_set(value, tsid) | |
| // | ||
| function mousetrails_get(tsid) | ||
| { | ||
| if (tsid != null || tsid === null) // TSID is not undefined or is explicitly null | ||
| if (tsid !== undefined) // TSID is not undefined | ||
| { | ||
| // Need to disatch to different session first | ||
| return (sessionDispatch(tsid, 'mouse', 'getTrails', [])); | ||
|
|
@@ -205,7 +205,7 @@ function mousetrails_get(tsid) | |
| // | ||
| function idle_getSeconds(tsid) | ||
| { | ||
| if (tsid != null || tsid === null) // TSID is not undefined or is explicitly null | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π idle_getSecondsAllSessions treats session-check TSID guard inconsistently with idle_getSeconds' tautological condition In π€ Prompt for AI agentsfix confidence: π‘ 80 medium β react π/π to teach the reviewer |
||
| if (tsid !== undefined) // TSID is not undefined | ||
| { | ||
| // Need to dispatch to different session first | ||
| return (sessionDispatch(tsid, 'idle', 'getSeconds', [])); | ||
|
|
@@ -296,4 +296,4 @@ function idle_getSecondsAllSessions() | |
| module.exports = { background: { get: background_get, set: background_set } }; | ||
| module.exports.mouse = { getTrails: mousetrails_get, setTrails: mousetrails_set }; | ||
| module.exports.idle = { getSeconds: idle_getSeconds, getSecondsAllSessions: idle_getSecondsAllSessions }; | ||
| module.exports.dispatch = dispatch; | ||
| module.exports.dispatch = dispatch; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -102,6 +102,7 @@ function windows_volumes() | |
| var germanpass = (abc !== '' && abc.includes('Kennwort:') && !abc.includes('Numerisches Kennwort:')); // German Password | ||
| var frenchpass = (abc !== '' && abc.includes('Mot de passe :') && !abc.includes('Mot de passe num')); // French Password | ||
| if (englishidpass || germanidpass || frenchidpass|| englishpass || germanpass || frenchpass) { | ||
| if (x + 1 >= lines.length) { continue; } | ||
| var nextline = lines[x + 1].trim(); | ||
| if (x + 1 < lines.length && (nextline !== '' && (nextline.startsWith('ID:') || nextline.startsWith('ID :')) )) { | ||
| identifier = nextline.replace('ID:','').replace('ID :', '').trim(); | ||
|
Comment on lines
102
to
108
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π win-volumes.js: bitlocker recovery password parser reads lines[x+1] with no bounds check before out-of-range access In π€ Prompt for AI agentsfix confidence: π’ 90 high β react π/π to teach the reviewer |
||
|
|
@@ -125,4 +126,4 @@ function windows_volumes() | |
| module.exports = { | ||
| getVolumes: function () { try { return (getVolumes()); } catch (x) { return ({}); } }, | ||
| volumes_promise: windows_volumes | ||
| }; | ||
| }; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
𦩠π meshagent_diagnostic downloads and installs an agent binary over HTTPS with rejectUnauthorized explicitly disabled
In
DownloadAgentBinary(), removed the{ rejectUnauthorized: false }options argument passed towget(), so the HTTPS download now relies on default certificate validation instead of explicitly disabling it. This closes the MITM window on the agent-binary download used for self-healing/service install. Risk: if the target server legitimately uses a self-signed/internal CA certificate that this override was working around, the download will now fail closed (safer, but could break deployments relying on the previous insecure bypass) β a complete fix in such environments would require pinning/trusting the specific server certificate rather than disabling validation entirely, which is outside the scope of this single-file change.π€ Prompt for AI agents
fix confidence: π‘ 70 medium β react π/π to teach the reviewer