T03 · Remote Payload Retrieval and Execution
- Location
- references/devbridge-tunnel.md:3
- Finding
- Unverified Remote Installer Scripts Are Executed Directly<![CDATA[ ## Vulnerability Details **File Location**: `references/devbridge-tunnel.md:3-27`; `references/troubleshooting.md:148` **Vulnerability Type**: Remote payload retrieval and immediate execution **Risk Level**: Critical ### Vulnerable Code ```bash # references/devbridge-tunnel.md:3-9 ### Linux / macOS ```bash curl -fsSL https://res-hd.hc-cdn.cn/sharedata/hdspace/devbridge/install.sh | bash ``` ``` ```bash # references/devbridge-tunnel.md:17-21 rm -rf /root/.huawei/devbridge 2>/dev/null echo "y" | curl -fsSL https://res-hd.hc-cdn.cn/sharedata/hdspace/devbridge/install.sh | bash ``` ```powershell # references/devbridge-tunnel.md:23-27 ### Windows (PowerShell 5.1+) ```powershell irm https://res-hd.hc-cdn.cn/sharedata/hdspace/devbridge/install.ps1 | iex ``` ``` ```bash # references/troubleshooting.md:148 curl -sSL https://res-hw-global.obs.ap-southeast-1.myhuaweicloud.com/cli/latest/hcloud_install.sh -o hcloud_install.sh && bash hcloud_install.sh ``` ### Technical Analysis The documented installation procedures retrieve mutable scripts from external URLs and immediately execute them with Bash or PowerShell. The procedures do not pin an immutable version, verify a cryptographic signature, compare a pinned digest, or provide a review boundary between download and execution. The headless installation workaround is particularly dangerous because it first removes the existing DevBridge configuration directory and then supplies automatic confirmation to the unverified installer. This removes safeguards and may destroy configuration or security state before executing externally controlled code. HTTPS protects the transport connection but does not protect against compromise of the hosting account, CDN, object-storage bucket, DNS infrastructure, signing pipeline, or upstream installer itself. ### Attack Path 1. An attacker compromises the installer origin, CDN distribution, storage bucket, DNS path, or vendor publishing account. 2. The attacker replaces t ...[truncated 926 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove all `curl | bash`, `Invoke-RestMethod | Invoke-Expression`, and equivalent direct-execution instructions. 2. Publish immutable, versioned installer artifacts. 3. Download the artifact to a new file without executing it. 4. Verify a vendor signature and a pinned SHA-256 or stronger digest before execution. 5. Display the resolved version, source, digest, and requested filesystem changes to the user. 6. Require explicit user confirmation before running the verified installer. 7. Run installation with the lowest available privileges and in a sandbox where possible. 8. Do not automatically remove existing credential or configuration directories. 9. Document a manual installation path that allows source review. ]]>
