T03 · Remote Payload Retrieval and Execution
- Location
references/command-spec.md:693- Finding
Caller-Controlled Remote Update Allows Arbitrary Payload Execution
- Content
View full analysis
Vulnerability Details
File Location:
references/command-spec.md, lines 693-699
Related Locations:SKILL.md, lines 65-66, 87, and 106-107
Vulnerability Type: T03: Remote Payload Retrieval and Execution
Risk Level: CriticalVulnerable Code Snippet
markdown ## 11. node.selfUpdate 用途:执行节点自更新。流程为参数校验 -> 当前程序 MD5 比对 -> HTTP 下载 -> 下载包 MD5 比对 -> 写入临时文件 -> 生成并启动更新 bat -> `node.invoke` 回包后延迟退出当前节点。 `params`: - `downloadUrl`:字符串,必填。新版本程序完整下载地址(仅支持 `http/https`)。 - `md5`:字符串,必填。32 位十六进制 MD5;若与当前程序一致,返回无需更新。Related instructions in
SKILL.mdinclude:markdown - `node.selfUpdate`:30000-300000(下载+校验+脚本启动;成功后节点会退出重启) - 调用 `node.selfUpdate` 时,`md5` 为必填(32 位十六进制);缺失或格式错误按 `INVALID_PARAMS` 处理。markdown - `command not allowlisted`: - 说明这是 Gateway 策略拦截。 - 提示管理员在 Gateway 配置添加 `gateway.nodes.allowCommands`(如 `file.read`、`file.write`、`process.exec`、`process.manage`、`system.run`、`process.which`、`system.notify`、`system.clipboard`、`system.input`、`node.selfUpdate`)。Technical Analysis
The
node.selfUpdatecapability accepts a caller-provideddownloadUrlover either HTTP or HTTPS and a caller-provided MD5 value. It then downloads the referenced file, compares it with the supplied digest, writes it to a temporary file, generates and starts an update BAT file, and exits the current node so that the replacement can take effect.The integrity check does not establish payload authenticity because the same caller controls both the executable URL and its expected MD5. An attacker can calculate the MD5 of an arbitrary malicious executable and provide both values in one request. MD5 is also cryptographically obsolete and unsuitable for security-sensitive release verification.
The specification does not require:
- A trusted update-origin allowlist.
- HTTPS-only transport.
- Certificate or public-key pinning.
- A digitally signed release manifest.
- Verification against an embedded trusted publisher key.
- A trusted mapping bet ...[truncated 2187 chars]
- Remediation
View remediation
Remediation Suggestions
-
Eliminate arbitrary update sources
- Do not accept unrestricted caller-provided update URLs.
- Resolve approved versions through a server-controlled release manifest.
- Enforce a strict allowlist of official update hosts and expected URL paths.
-
Require secure transport
- Remove support for plaintext HTTP.
- Require HTTPS with strict certificate validation.
- Consider public-key or certificate pinning for the official update service.
-
Implement cryptographic authenticity verification
- Sign release manifests and update packages using an offline-protected release key.
- Embed only the trusted verification public key in the node or hardened updater.
- Reject any package without a valid signature, regardless of its digest.
- Ensure the signed data covers the version, platform, architecture, package hash, size, and release channel.
-
Replace MD5
- Use SHA-256 or stronger for package-integrity checking.
- Treat hashes as integrity metadata only; do not use a caller-supplied hash as proof of publisher authenticity.
-
Strengthen authorization
- Restrict
node.selfUpdateto a dedicated administrative role. - Require explicit user confirmation for each update.
- Apply gateway policy that binds the command to approved update versions and sources.
- Do not recommend broadly allowlisting
node.selfUpdateuntil the update trust model is corrected.
- Restrict
-
Harden update execution
- Use a minimal, dedicated updater rather than dynamically generated command scripts where feasible.
- Store temporary packages in a protected directory with restrictive permissions.
- Prevent symbolic-link and file-replacement attacks.
- Verify the package immediately before installation and again before execution.
- Add downgrade prevention, atomic replacement, rollback, and recovery checks.
-
Improve monitoring
- Log the authenticated requester, approved version, sourc ...[truncated 168 chars]
-
