T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:43
- Finding
- Unverified Remote Installer Download and Immediate Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 43–54 **Vulnerability Type**: Remote payload retrieval and execution without integrity verification **Risk Level**: Critical ### Vulnerable Code ```markdown ### macOS & Linux Execute the following script in your local terminal to install TRAE CLI: ```bash sh -c "$(curl -L https://lf-cdn.trae.com.cn/obj/trae-com-cn/trae-cli/install.sh)" && export PATH=~/.local/bin:$PATH ``` ### Windows (PowerShell) Execute the following script in PowerShell to install TRAE CLI: ```powershell irm https://lf-cdn.trae.com.cn/obj/trae-com-cn/trae-cli/install.ps1 | iex ``` ``` ### Technical Analysis Both installation commands retrieve executable content from an external URL and pass it directly to a command interpreter: - On macOS and Linux, `curl` downloads `install.sh`, and command substitution passes its contents to `sh -c`. - On Windows, `Invoke-RestMethod` (`irm`) downloads `install.ps1`, and the pipeline passes it to `Invoke-Expression` (`iex`). The instructions do not pin the installer to an immutable release and do not require checksum or cryptographic-signature verification. They also do not provide an intermediate inspection step. Consequently, the code executed at installation time can differ from the content that was available when this skill was audited. This creates a remote code-execution supply-chain boundary: compromise of the distribution server, publishing account, DNS/TLS trust path, or installer delivery process could cause users to execute attacker-controlled commands. The repository does not contain the remote installer, so the behavior of that payload could not be verified during this audit. The risk is amplified because the skill advertises broad Bash and file-modification capabilities and describes Git, plugin, MCP, and CI/CD integration. These features could increase the accessible data and operational scope after a compromised installation, although no evidence of such abus ...[truncated 1593 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove direct pipe-to-interpreter and command-substitution installation patterns. 2. Pin downloads to a specific immutable release rather than a mutable installer URL. 3. Download the installer to a local file without executing it: ```bash curl --fail --location --proto '=https' --tlsv1.2 \ --output traecli-install.sh \ 'https://trusted.example/path/to/versioned/install.sh' ``` 4. Publish the expected SHA-256 digest through an independently protected release channel and verify it before execution: ```bash echo '<EXPECTED_SHA256> traecli-install.sh' | sha256sum --check - ``` 5. Prefer vendor-signed artifacts and verify the cryptographic signature against a documented, pinned vendor key. 6. Allow users to inspect the downloaded script before running it, and document its expected file, network, and permission changes. 7. Execute installation with the minimum required privileges. Explicitly warn users not to use an administrator or root shell unless a reviewed installation step requires it. 8. Apply the same staged download and verification process on Windows using `Invoke-WebRequest`, `Get-FileHash`, and an Authenticode signature check instead of `irm ... | iex`. 9. Disable automatic upgrades by default or require upgrades to use the same version pinning and signature-verification controls. 10. For CI/CD use, mirror a reviewed, immutable artifact in a controlled internal registry and validate its digest before every installation. ]]>
