T03 · Remote Payload Retrieval and Execution
Error
- Location
- references/installation-errors.md:32
- Finding
- Remote installation scripts are executed directly without integrity verification<![CDATA[ ## Vulnerability Details **File Location**: `references/installation-errors.md:32, 39, 105, 349, 367` **Vulnerability Type**: Remote payload retrieval followed by immediate shell execution **Risk Level**: High ### Vulnerable Code ```bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash ``` Additional instances include: ```bash curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - curl -fsSL https://get.pnpm.io/install.sh | sh - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` ### Technical Analysis The installation documentation streams externally hosted content directly into a shell. The downloaded response is not authenticated using a release signature or expected cryptographic digest and is not saved for inspection before execution. Although these commands appear in reference documentation rather than being invoked automatically by Python code, they are presented as operational remediation instructions. A user or agent following the instructions will execute the effective remote payload. The NodeSource examples are especially sensitive because the remote response is passed to a shell through `sudo`, giving the fetched payload root privileges. HTTPS protects the transport channel but does not protect against compromise of the upstream repository, hosting account, publishing workflow, or authorized content itself. ### Attack Path 1. An attacker compromises an upstream hosting account, repository, release process, or remote installation endpoint. 2. The attacker modifies the remotely served installation script. 3. A user follows the troubleshooting instructions. 4. `curl` retrieves the attacker-controlled response. 5. The shell interprets the response immediately, without integrity verification or review. 6. For the NodeSource command, the payload executes with root privileges. 7. The payload can modify system files, install services, steal credentia ...[truncated 382 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Do not pipe network responses directly into `bash` or `sh`. 2. Download a version-pinned installer to a temporary file first. 3. Obtain expected SHA-256 digests from an independently authenticated release channel. 4. Verify the digest or upstream release signature before execution. 5. Display the downloaded script and require explicit user approval. 6. Prefer distribution packages or package-manager repositories with signed metadata. 7. Separate privileged operations from unprivileged installation steps. 8. Pin installer versions instead of using mutable paths such as `HEAD`. 9. Document the exact files and system settings that the installer will modify. ]]>
