Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a344c39
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
3f8dd87
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
f28465b
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
2172f27
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
6663cc2
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
75ced05
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
aae040c
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
a7988ce
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
731abc1
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
52597e1
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
93cce24
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
9ee365c
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
37008de
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
7d55e8e
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
b8559d1
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
66b269e
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
c0d39a2
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
dddc888
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
7b8e2fa
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
de1c2ec
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
6da0570
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
58488f1
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
5724292
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
fe84804
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
91aa6ff
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
da24553
fix(adhoc-sweep-fixes): 34 review findings across 27 files
flamingo[bot] Aug 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions agents/meshcore_diagnostic.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown
Author

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 to wget(), 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
In agents/meshcore_diagnostic.js around line 81, review and complete this code-review fix: meshagent_diagnostic downloads and installs an agent binary over HTTPS with rejectUnauthorized explicitly disabled.
What the draft fix changed: In `DownloadAgentBinary()`, removed the `{ rejectUnauthorized: false }` options argument passed to `wget()`, 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.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟑 70 medium β€” react πŸ‘/πŸ‘Ž to teach the reviewer

Comment on lines 85 to 93

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 πŸ”΅ Log message typo 'downlod' will pollute server diagnostic logs

In DownloadAgentBinary(), fixed the typo in the sendServerLog call from "Attempting to downlod agent from:" to "Attempting to download agent from:", matching the suggested fix exactly.

πŸ€– Prompt for AI agents
In agents/meshcore_diagnostic.js around line 84, review and complete this code-review fix: Log message typo 'downlod' will pollute server diagnostic logs.
What the draft fix changed: In `DownloadAgentBinary()`, fixed the typo in the `sendServerLog` call from "Attempting to downlod agent from:" to "Attempting to download agent from:", matching the suggested fix exactly.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟒 95 high β€” react πŸ‘/πŸ‘Ž to teach the reviewer

Expand Down Expand Up @@ -204,3 +204,4 @@ function start()
}
}
};

2 changes: 1 addition & 1 deletion agents/modules_meshcmd/amt-wsman.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 🟠 amt-wsman.js ExecSubscribe declares opaque parameter and re-declares it as a local var, shadowing the argument

In obj.ExecSubscribe (agents/modules_meshcmd/amt-wsman.js), removed the redundant opaque = "" re-declaration from the var digest = "", digest2 = "", opaque = ""; statement, leaving var digest = "", digest2 = "";. This stops the local var from shadowing/overwriting the incoming opaque function parameter, so the subsequent if (opaque != null) { opaque = '<a:ReferenceParameters>...' } check and the rest of the function now correctly use the caller-supplied opaque value.

πŸ€– Prompt for AI agents
In agents/modules_meshcmd/amt-wsman.js around line 60, review and complete this code-review fix: amt-wsman.js ExecSubscribe declares `opaque` parameter and re-declares it as a local var, shadowing the argument.
What the draft fix changed: In `obj.ExecSubscribe` (agents/modules_meshcmd/amt-wsman.js), removed the redundant `opaque = ""` re-declaration from the `var digest = "", digest2 = "", opaque = "";` statement, leaving `var digest = "", digest2 = "";`. This stops the local `var` from shadowing/overwriting the incoming `opaque` function parameter, so the subsequent `if (opaque != null) { opaque = '<a:ReferenceParameters>...' }` check and the rest of the function now correctly use the caller-supplied `opaque` value.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟒 95 high β€” react πŸ‘/πŸ‘Ž to teach the reviewer

Expand Down
7 changes: 4 additions & 3 deletions agents/modules_meshcore/sysinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The 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 var to the first child = require('child_process').execFile('/bin/sh', ['sh']); assignment so it becomes var child = ..., eliminating the implicit global leak. The second assignment later in the same function intentionally reuses the same locally-scoped child variable (already declared via var in this fix) to run a second shell command, which is correct existing behavior and requires no var since it's the same function-scoped variable.

πŸ€– Prompt for AI agents
In agents/modules_meshcore/sysinfo.js around line 197, review and complete this code-review fix: macos_thermals references undeclared global 'child' variable via implicit global leak.
What the draft fix changed: In linux_thermals (agents/modules_meshcore/sysinfo.js), added `var` to the first `child = require('child_process').execFile('/bin/sh', ['sh']);` assignment so it becomes `var child = ...`, eliminating the implicit global leak. The second assignment later in the same function intentionally reuses the same locally-scoped `child` variable (already declared via `var` in this fix) to run a second shell command, which is correct existing behavior and requires no `var` since it's the same function-scoped variable.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟒 90 high β€” react πŸ‘/πŸ‘Ž to teach the reviewer

Comment on lines 218 to 230

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The 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 return (mem); to ret._res(mem); followed by return (ret);, and changed the failure path from throw ('Parse Error'); to ret._rej('Parse Error'); followed by return (ret);, restructuring the if/else so both branches fall through to a single return (ret); at the end. This aligns the function's contract with its promise-based siblings (windows_cpuUtilization, linux_cpuUtilization, macos_cpuUtilization). Risk: any existing caller that relied on the old synchronous return value of mem or caught the thrown string will now need to use the promise interface instead β€” this is a behavioral change required by the finding but could affect callers outside this file that aren't visible here.

(Automatically downgraded: no change in this fix lands near this finding's line β€” verify whether it was actually addressed.)

πŸ€– Prompt for AI agents
In agents/modules_meshcore/sysinfo.js around line 168, review and complete this code-review fix: macos_memUtilization throws a plain string instead of an Error and never uses the promise it constructs.
What the draft fix changed: In macos_memUtilization, changed the success path from `return (mem);` to `ret._res(mem);` followed by `return (ret);`, and changed the failure path from `throw ('Parse Error');` to `ret._rej('Parse Error');` followed by `return (ret);`, restructuring the if/else so both branches fall through to a single `return (ret);` at the end. This aligns the function's contract with its promise-based siblings (windows_cpuUtilization, linux_cpuUtilization, macos_cpuUtilization). Risk: any existing caller that relied on the old synchronous return value of `mem` or caught the thrown string will now need to use the promise interface instead β€” this is a behavioral change required by the finding but could affect callers outside this file that aren't visible here.

_(Automatically downgraded: no change in this fix lands near this finding's line β€” verify whether it was actually addressed.)_
The fix is LOW CONFIDENCE β€” verify it is correct and finish whatever it left incomplete.

fix confidence: πŸ”΄ 40 low β€” review closely β€” react πŸ‘/πŸ‘Ž to teach the reviewer

Expand All @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion agents/modules_meshcore/wifi-scanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 🟠 wifi-scanner.js leaks tokens as an implicit global (missing var/let)

Changed tokens = str.split(' - Address: '); to var tokens = str.split(' - Address: '); inside the this.child.ms.on('end', function () {...}) callback in WiFiScanner.prototype.Scan, declaring tokens as a function-local variable instead of an implicit global.

πŸ€– Prompt for AI agents
In agents/modules_meshcore/wifi-scanner.js around line 87, review and complete this code-review fix: wifi-scanner.js leaks `tokens` as an implicit global (missing var/let).
What the draft fix changed: Changed `tokens = str.split(' - Address: ');` to `var tokens = str.split(' - Address: ');` inside the `this.child.ms.on('end', function () {...})` callback in `WiFiScanner.prototype.Scan`, declaring `tokens` as a function-local variable instead of an implicit global.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟒 95 high β€” react πŸ‘/πŸ‘Ž to teach the reviewer

Expand Down
12 changes: 6 additions & 6 deletions agents/modules_meshcore/win-deskutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
{

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The 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 (if (tsid != null || tsid === null) β†’ if (tsid !== undefined)) to background_get, background_set, mousetrails_set, and mousetrails_get, restoring the intended fast in-process path for calls made without a tsid argument, consistent with the fix in idle_getSeconds.

πŸ€– Prompt for AI agents
In agents/modules_meshcore/win-deskutils.js around line 108, review and complete this code-review fix: Tautological TSID guard duplicated across background_get/set and mousetrails_get/set.
What the draft fix changed: Applied the identical fix (`if (tsid != null || tsid === null)` β†’ `if (tsid !== undefined)`) to `background_get`, `background_set`, `mousetrails_set`, and `mousetrails_get`, restoring the intended fast in-process path for calls made without a tsid argument, consistent with the fix in `idle_getSeconds`.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟑 80 medium β€” react πŸ‘/πŸ‘Ž to teach the reviewer

// Need to disatch to different session first
return (sessionDispatch(tsid, 'background', 'get', []));
Expand All @@ -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]));
Expand Down Expand Up @@ -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]));
Expand All @@ -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', []));
Expand All @@ -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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The 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 idle_getSeconds (line ~208), replaced the tautological guard if (tsid != null || tsid === null) with if (tsid !== undefined) so the direct-call fast path below is reachable when tsid is omitted/undefined, and sessionDispatch is only invoked when a tsid is explicitly provided (including null, matching the original comment's intent of "not undefined or is explicitly null").

πŸ€– Prompt for AI agents
In agents/modules_meshcore/win-deskutils.js around line 208, review and complete this code-review fix: idle_getSecondsAllSessions treats session-check TSID guard inconsistently with idle_getSeconds' tautological condition.
What the draft fix changed: In `idle_getSeconds` (line ~208), replaced the tautological guard `if (tsid != null || tsid === null)` with `if (tsid !== undefined)` so the direct-call fast path below is reachable when `tsid` is omitted/undefined, and sessionDispatch is only invoked when a tsid is explicitly provided (including `null`, matching the original comment's intent of "not undefined or is explicitly null").
Verify the change is correct and complete; do not refactor unrelated code.

fix 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', []));
Expand Down Expand Up @@ -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;
3 changes: 2 additions & 1 deletion agents/modules_meshcore/win-volumes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The 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 windows_volumes, inside the manage-bde output parsing loop, added a bounds check if (x + 1 >= lines.length) { continue; } immediately before var nextline = lines[x + 1].trim();, preventing the unconditional out-of-range array access on lines[x + 1] when the marker line is the last line of output. The pre-existing x + 1 < lines.length checks on the following branches are left intact and now function correctly since nextline is only computed when the index is valid.

πŸ€– Prompt for AI agents
In agents/modules_meshcore/win-volumes.js around line 91, review and complete this code-review fix: win-volumes.js: bitlocker recovery password parser reads lines[x+1] with no bounds check before out-of-range access.
What the draft fix changed: In `windows_volumes`, inside the manage-bde output parsing loop, added a bounds check `if (x + 1 >= lines.length) { continue; }` immediately before `var nextline = lines[x + 1].trim();`, preventing the unconditional out-of-range array access on `lines[x + 1]` when the marker line is the last line of output. The pre-existing `x + 1 < lines.length` checks on the following branches are left intact and now function correctly since `nextline` is only computed when the index is valid.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟒 90 high β€” react πŸ‘/πŸ‘Ž to teach the reviewer

Expand All @@ -125,4 +126,4 @@ function windows_volumes()
module.exports = {
getVolumes: function () { try { return (getVolumes()); } catch (x) { return ({}); } },
volumes_promise: windows_volumes
};
};
Loading