-
Notifications
You must be signed in to change notification settings - Fork 0
fix(adhoc-sweep-fixes): CU-86akhf8u3 15 review findings across 10 files #122
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
3eb4107
9094d22
4d480ca
4f07439
9e17da5
59e9821
4e2d6ef
30fa2a0
e552c87
12ebf0b
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 |
|---|---|---|
|
|
@@ -7,8 +7,8 @@ | |
| * | ||
| */ | ||
|
|
||
| #ifndef LINUX_TILE_H_ | ||
|
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. 🦩 🟠 Include guard macro name mismatches actual file (LINUX_TILE_H_ in mac_tile.h) Changed the include guard macro in meshcore/KVM/MacOS/mac_tile.h from 🤖 Prompt for AI agentsfix confidence: 🟢 95 high — react 👍/👎 to teach the reviewer |
||
| #define LINUX_TILE_H_ | ||
| #ifndef MAC_TILE_H_ | ||
| #define MAC_TILE_H_ | ||
|
|
||
| #include <stdio.h> | ||
| #include <stdlib.h> | ||
|
|
@@ -37,5 +37,6 @@ extern int getScreenBuffer(unsigned char **desktop, long long *desktopsize, CGIm | |
| extern void set_tile_compression(int type, int level); | ||
|
|
||
|
|
||
| #endif /* LINUX_TILE_H_ */ | ||
| #endif /* MAC_TILE_H_ */ | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -214,7 +214,7 @@ void ILibMulticastSocket_BroadcastUdpPacketV4(struct ILibMulticastSocket_StateMo | |
| #ifndef NACL | ||
| if (module->UDPServers[i] != NULL) | ||
| { | ||
| socket = ILibAsyncUDPSocket_GetSocket(module->UDPServer); | ||
| socket = ILibAsyncUDPSocket_GetSocket(module->UDPServers[i]); | ||
| setsockopt(socket, IPPROTO_IP, IP_MULTICAST_IF, (const char*)&(module->AddressListV4[i].sin_addr), sizeof(struct in_addr)); | ||
| setsockopt(socket, IPPROTO_IP, IP_MULTICAST_TTL, (const char*)&(module->TTL), sizeof(int)); | ||
| for (j = 0; j < count; j++) sendto(socket, data, datalen, 0, (struct sockaddr*)addr, sizeof(struct sockaddr_in)); | ||
|
Comment on lines
214
to
220
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. 🦩 🟠 ILibMulticastSocket_BroadcastUdpPacketV4 uses module->UDPServer instead of the per-interface module->UDPServers[i] socket In 🤖 Prompt for AI agentsfix confidence: 🟢 98 high — react 👍/👎 to teach the reviewer |
||
|
|
@@ -397,3 +397,4 @@ void ILibMulticastSocket_WakeOnLan(void *module, char* mac) | |
| ILibMulticastSocket_Broadcast((struct ILibMulticastSocket_StateModule*)module, ILibScratchPad, 102, 1); | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,10 @@ function getOpenFrameMachineId() { | |
| ? '/Library/Application Support/OpenFrame/machine_id' | ||
| : '/var/lib/openframe/machine_id'); | ||
| openframeMachineId = fs.readFileSync(machineIdPath).toString().trim(); | ||
| } catch (ex) { openframeMachineId = null; } | ||
| } catch (ex) { | ||
| openframeMachineId = null; | ||
| try { sendConsoleText('getOpenFrameMachineId error: ' + ex); } catch (ex2) { console.log('getOpenFrameMachineId error: ' + ex); } | ||
| } | ||
| return openframeMachineId; | ||
| } | ||
|
|
||
|
Comment on lines
17
to
26
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. 🦩 🟠 getOpenFrameMachineId silently swallows all errors including unexpected exceptions In getOpenFrameMachineId() (modules/RecoveryCore.js), the catch block now logs the exception before discarding it, via sendConsoleText (with a console.log fallback in case sendConsoleText itself throws, e.g. if MeshAgent isn't ready yet), so unexpected exceptions surface for diagnosis instead of being silently swallowed, while still degrading openframeMachineId to null so existing "file not found" behavior is preserved. 🤖 Prompt for AI agentsfix confidence: 🟡 80 medium — react 👍/👎 to teach the reviewer |
||
|
|
@@ -502,3 +505,4 @@ function deleteFolderRecursive(path, rec) { | |
| fs.unlinkSync(path); | ||
| } | ||
| }; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,42 +70,6 @@ function _ParseWsmanRec(node) { | |
| return r; | ||
| } | ||
|
|
||
| function _PutObjToBodyXml(resuri, putObj) { | ||
|
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. 🦩 🟠 _PutObjToBodyXml / _ObjectToXmlAttributes duplicated verbatim between amt-wsman.js and amt-xml.js Removed the dead/broken 🤖 Prompt for AI agentsfix confidence: 🟢 90 high — react 👍/👎 to teach the reviewer |
||
| if (!resuri || putObj == null) return ''; | ||
| var objname = obj.GetNameFromUrl(resuri); | ||
| var result = '<r:' + objname + ' xmlns:r="' + resuri + '">'; | ||
|
|
||
| for (var prop in putObj) { | ||
| if (!putObj.hasOwnProperty(prop) || prop.indexOf('__') === 0 || prop.indexOf('@') === 0) continue; | ||
| if (putObj[prop] == null || typeof putObj[prop] === 'function') continue; | ||
| if (typeof putObj[prop] === 'object' && putObj[prop]['ReferenceParameters']) { | ||
| result += '<r:' + prop + '><a:Address>' + putObj[prop].Address + '</a:Address><a:ReferenceParameters><w:ResourceURI>' + putObj[prop]['ReferenceParameters']["ResourceURI"] + '</w:ResourceURI><w:SelectorSet>'; | ||
| var selectorArray = putObj[prop]['ReferenceParameters']['SelectorSet']['Selector']; | ||
| if (Array.isArray(selectorArray)) { | ||
| for (var i = 0; i < selectorArray.length; i++) { | ||
| result += '<w:Selector' + _ObjectToXmlAttributes(selectorArray[i]) + '>' + selectorArray[i]['Value'] + '</w:Selector>'; | ||
| } | ||
| } | ||
| else { | ||
| result += '<w:Selector' + _ObjectToXmlAttributes(selectorArray) + '>' + selectorArray['Value'] + '</w:Selector>'; | ||
| } | ||
| result += '</w:SelectorSet></a:ReferenceParameters></r:' + prop + '>'; | ||
| } | ||
| else { | ||
| if (Array.isArray(putObj[prop])) { | ||
| for (var i = 0; i < putObj[prop].length; i++) { | ||
| result += '<r:' + prop + '>' + putObj[prop][i].toString() + '</r:' + prop + '>'; | ||
| } | ||
| } else { | ||
| result += '<r:' + prop + '>' + putObj[prop].toString() + '</r:' + prop + '>'; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| result += '</r:' + objname + '>'; | ||
| return result; | ||
| } | ||
|
|
||
| // This is a drop-in replacement to _turnToXml() that works without xml parser dependency. | ||
| function _treeBuilder() { | ||
| this.tree = []; | ||
|
|
@@ -187,3 +151,4 @@ function _turnToXmlRec(text) { | |
| } catch (ex) { return null; } | ||
| return lastElement; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -262,32 +262,32 @@ function amt_heci() { | |
| fn.apply(this, opt); | ||
| }, callback, optional); | ||
| } | ||
| this.startConfiguration = function () { | ||
|
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_heci.js startConfiguration/stopConfiguration/openUserInitiatedConnection/closeUserInitiatedConnection reference undeclared Added 🤖 Prompt for AI agentsfix confidence: 🟢 95 high — react 👍/👎 to teach the reviewer |
||
| this.startConfiguration = function (data, callback) { | ||
| var optional = []; | ||
| for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } | ||
| this.sendCommand(0x29, data, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); | ||
| } | ||
| this.stopConfiguration = function () { | ||
|
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_heci.js stopConfiguration references undeclared Added 🤖 Prompt for AI agentsfix confidence: 🟢 95 high — react 👍/👎 to teach the reviewer |
||
| this.stopConfiguration = function (data, callback) { | ||
| var optional = []; | ||
| for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } | ||
| this.sendCommand(0x5E, data, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); | ||
| } | ||
| this.openUserInitiatedConnection = function () { | ||
|
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_heci.js openUserInitiatedConnection references undeclared Added 🤖 Prompt for AI agentsfix confidence: 🟢 95 high — react 👍/👎 to teach the reviewer |
||
| this.openUserInitiatedConnection = function (data, callback) { | ||
| var optional = []; | ||
| for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } | ||
| this.sendCommand(0x44, data, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); | ||
| } | ||
| this.closeUserInitiatedConnection = function () { | ||
|
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_heci.js closeUserInitiatedConnection references undeclared Added 🤖 Prompt for AI agentsfix confidence: 🟢 95 high — react 👍/👎 to teach the reviewer |
||
| this.closeUserInitiatedConnection = function (data, callback) { | ||
| var optional = []; | ||
| for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } | ||
| this.sendCommand(0x45, data, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); | ||
| } | ||
| this.getRemoteAccessConnectionStatus = function () { | ||
|
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_heci.js getRemoteAccessConnectionStatus references undeclared In 🤖 Prompt for AI agentsfix confidence: 🟢 90 high — react 👍/👎 to teach the reviewer |
||
| this.getRemoteAccessConnectionStatus = function (data, callback) { | ||
| var optional = []; | ||
| for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } | ||
| this.sendCommand(0x46, data, function (header, fn, opt) { | ||
| if (header.Status == 0) { | ||
| var hostname = v.slice(14, header.Data.readUInt16LE(12) + 14).toString() | ||
| var hostname = header.Data.slice(14, header.Data.readUInt16LE(12) + 14).toString() | ||
| opt.unshift({ status: header.Status, networkStatus: header.Data.readUInt32LE(0), remoteAccessStatus: header.Data.readUInt32LE(4), remoteAccessTrigger: header.Data.readUInt32LE(8), mpsHostname: hostname, raw: header.Data }); | ||
| } else { | ||
| opt.unshift({ status: header.Status }); | ||
|
|
@@ -297,7 +297,7 @@ function amt_heci() { | |
| } | ||
| this.getProtocolVersion = function (callback) { | ||
|
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_heci.js getProtocolVersion references undeclared In 🤖 Prompt for AI agentsfix confidence: 🟢 95 high — react 👍/👎 to teach the reviewer |
||
| var optional = []; | ||
| for (var i = 1; i < arguments.length; ++i) { opt.push(arguments[i]); } | ||
| for (var i = 1; i < arguments.length; ++i) { optional.push(arguments[i]); } | ||
|
|
||
| heci.doIoctl(heci.IOCTL.HECI_VERSION, Buffer.alloc(5), Buffer.alloc(5), function (status, buffer, self, fn, opt) { | ||
| if (status == 0) { | ||
|
|
@@ -313,4 +313,4 @@ function amt_heci() { | |
| } | ||
| } | ||
|
|
||
| module.exports = amt_heci; | ||
| module.exports = amt_heci; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -141,7 +141,7 @@ function lme_heci() | |
| break; | ||
| case APF_SERVICE_REQUEST: | ||
| var nameLen = chunk.readUInt32BE(1); | ||
|
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. 🦩 🟠 Buffer comparison with == instead of string equality check may never match In the APF_SERVICE_REQUEST case of lme_heci()'s data handler, changed 🤖 Prompt for AI agentsfix confidence: 🟢 97 high — react 👍/👎 to teach the reviewer |
||
| var name = chunk.slice(5, nameLen + 5); | ||
| var name = chunk.slice(5, nameLen + 5).toString(); | ||
| //console.log("Service Request for: " + name); | ||
| if (name == 'pfwd@amt.intel.com' || name == 'auth@amt.intel.com') | ||
| { | ||
|
|
@@ -353,3 +353,4 @@ function lme_heci() | |
| } | ||
|
|
||
| module.exports = lme_heci; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -166,7 +166,21 @@ function processManager() { | |
| p.waitExit(); | ||
| } | ||
|
|
||
| var J = JSON.parse(p.stdout.str); | ||
|
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. 🦩 🟠 getProcesses() on linux does not check p.stdout.str for empty/parse errors before JSON.parse, risking an uncaught exception on malformed awk output In 🤖 Prompt for AI agentsfix confidence: 🟡 75 medium — react 👍/👎 to teach the reviewer |
||
| try | ||
| { | ||
| var J = JSON.parse(p.stdout.str); | ||
| } | ||
| catch (parseErr) | ||
| { | ||
| if (callback) | ||
| { | ||
| p.args = []; | ||
| for (var i = 1; i < arguments.length; ++i) { p.args.push(arguments[i]); } | ||
| p.args.unshift(null); | ||
| callback.apply(this, p.args); | ||
| } | ||
| break; | ||
| } | ||
| if (callback) | ||
| { | ||
| p.args = []; | ||
|
|
@@ -209,7 +223,18 @@ function processManager() { | |
|
|
||
| if (callback) | ||
| { | ||
| var J = JSON.parse(p.stdout.str); | ||
| try | ||
| { | ||
| var J = JSON.parse(p.stdout.str); | ||
| } | ||
| catch (parseErr) | ||
| { | ||
| p.args = []; | ||
| for (var i = 1; i < arguments.length; ++i) { p.args.push(arguments[i]); } | ||
| p.args.unshift(null); | ||
| callback.apply(this, p.args); | ||
| break; | ||
| } | ||
| p.args = []; | ||
| for (var i = 1; i < arguments.length; ++i) { p.args.push(arguments[i]); } | ||
| if (process.platform == 'freebsd') | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -185,9 +185,29 @@ function vt() | |
| } | ||
| else | ||
| { | ||
| k32.ClosePseudoConsole(ret._h.Deref()); | ||
| k32.CloseHandle(ret._input.Deref()); | ||
| k32.CloseHandle(ret._output.Deref()); | ||
| k32.CloseHandle(ret._consoleInput.Deref()); | ||
| k32.CloseHandle(ret._consoleOutput.Deref()); | ||
| } | ||
| } | ||
|
|
||
| else | ||
| { | ||
| k32.ClosePseudoConsole(ret._h.Deref()); | ||
| k32.CloseHandle(ret._input.Deref()); | ||
| k32.CloseHandle(ret._output.Deref()); | ||
| k32.CloseHandle(ret._consoleInput.Deref()); | ||
| k32.CloseHandle(ret._consoleOutput.Deref()); | ||
| } | ||
| } | ||
| else | ||
| { | ||
| k32.ClosePseudoConsole(ret._h.Deref()); | ||
| k32.CloseHandle(ret._input.Deref()); | ||
| k32.CloseHandle(ret._output.Deref()); | ||
| k32.CloseHandle(ret._consoleInput.Deref()); | ||
| k32.CloseHandle(ret._consoleOutput.Deref()); | ||
| } | ||
| throw ('Internal Error'); | ||
| } | ||
|
Comment on lines
185
to
213
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. 🦩 🟠 CreatePseudoConsole handle and pipes leaked when CreateProcessW / UpdateProcThreadAttribute fails In vt.Create (modules/win-virtual-terminal.js), added cleanup blocks in the (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 |
||
|
|
@@ -235,4 +255,4 @@ function vt() | |
| if (process.platform == 'win32') | ||
| { | ||
| module.exports = new vt(); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -254,6 +254,8 @@ function enumerateProperties(j, fields) | |
| { | ||
| properties.push(nn.Deref().increment(i * GM.PointerSize).Deref().Wide2UTF8); | ||
| } | ||
|
|
||
| OleAut32.SafeArrayUnaccessData(nme.Deref()); | ||
| } | ||
|
|
||
| // Now we need to introspect the Array Fields | ||
|
Comment on lines
254
to
261
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. 🦩 🟠 SafeArrayAccessData success path never calls SafeArrayUnaccessData on the outer array in win-wmi.js enumerateProperties In 🤖 Prompt for AI agentsfix confidence: 🟡 85 medium — react 👍/👎 to teach the reviewer |
||
|
|
@@ -456,3 +458,4 @@ function query(resourceString, queryString, fields) | |
| } | ||
|
|
||
| module.exports = { query: query, queryAsync: queryAsync }; | ||
|
|
||
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.
🦩 🟠 build-openssl-windows.yml downloads and builds unpinned OpenSSL source via HTTPS with no checksum verification
In the "Download OpenSSL source" step of the
build-windowsjob (.github/workflows/build-openssl-windows.yml), added a download of the corresponding.sha256checksum file published alongside each OpenSSL GitHub release tarball, computed the actual SHA-256 of the downloaded tarball withsha256sum, and added a comparison that fails the step (exit 1) if the expected and actual checksums don't match or the expected checksum is empty, before extraction proceeds. This mitigates a corrupted/MITM'd download producing poisoned libs. Unverified: I have not confirmed that OpenSSL's GitHub release assets actually include a.sha256file at that exact URL path for every historical/future release (OpenSSL publishes SHA256 sums on openssl.org's download page and in some release notes, but the exact asset filename convention on GitHub Releases was not confirmed against the live release assets); if that asset does not exist for a given version, this step will fail closed (safe, but may block otherwise-valid builds) rather than silently skip verification. A more complete fix would pin the hash value explicitly per version (e.g., in a checked-in mapping) or verify a GPG signature against OpenSSL's published signing key rather than relying on a co-located hash file fetched over the same channel.🤖 Prompt for AI agents
fix confidence: 🔴 55 low — review closely — react 👍/👎 to teach the reviewer