T03 · Remote Payload Retrieval and Execution
- Location
- references/error-codes.md:133
- Finding
- Mutable Remote Installer Is Piped Directly Into a Shell<![CDATA[ ## Vulnerability Details **File Location**: `references/error-codes.md:133-136` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High ### Vulnerable Code ```bash 3. **Install Rust if needed:** ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` ``` ### Technical Analysis The troubleshooting instructions download a mutable script from an external URL and immediately execute the response through `sh`. The downloaded content is not pinned to an audited version, saved for inspection, or verified using an independently obtained checksum or digital signature. The HTTPS and TLS restrictions protect the connection in transit, but they do not protect against compromise of the upstream service, its deployment infrastructure, its signing account, DNS/CA trust, or a future unintended change to the remote installer. Consequently, the effective code executed by this Skill's instructions can change after the Skill package has been reviewed. Installing Rust may be useful for obtaining the `snpguest` dependency, but direct remote-to-shell execution is not the minimum-risk mechanism needed to satisfy that requirement. ### Attack Path 1. An attacker compromises the remote installer, its hosting infrastructure, or another component in the delivery chain. 2. A user follows the Skill's troubleshooting instructions. 3. `curl` retrieves the attacker-controlled response from `https://sh.rustup.rs`. 4. The pipe passes the response directly to `sh` without inspection or integrity verification. 5. The payload executes commands with all permissions held by the invoking user. 6. If the command is invoked from a privileged shell, the remote payload receives corresponding elevated privileges. ### Impact Assessment Successful exploitation provides arbitrary command execution under the invoking user's account. This may permit theft or modification of user files, installation of additional software, credential acc ...[truncated 375 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the `curl | sh` installation instruction. 2. Prefer a trusted operating-system package manager where an appropriate Rust package is available. 3. If a standalone installer is necessary: - Download a versioned installer to a local file. - Obtain its expected checksum or signature through an independently authenticated channel. - Verify the checksum or signature before execution. - Allow the user to inspect the downloaded script. - Execute the verified file as a separate command. 4. Pin and document the expected Rust toolchain and installer version. 5. Explicitly instruct users not to run the installer as root. 6. Document all filesystem and environment changes made by the selected installation process. ]]>
