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`, `references/installation-errors.md:39`, `references/installation-errors.md:105`, `references/installation-errors.md:367` **Vulnerability Type**: Remote payload retrieval and immediate execution **Risk Level**: Critical ### Vulnerable Code ```bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash ``` ```bash curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - sudo apt-get install -y nodejs ``` ```bash curl -fsSL https://get.pnpm.io/install.sh | sh - ``` ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` ### Technical Analysis These troubleshooting instructions send content retrieved from an external server directly to a command shell. The downloaded content is not saved for inspection, and no cryptographic signature or checksum is verified before execution. The NodeSource variant is particularly dangerous because the remote response is executed through `sudo`, giving the downloaded script root privileges. The Homebrew command retrieves from the mutable `HEAD` branch rather than a version-pinned revision. Although the NVM URL contains a version, version pinning alone does not verify the integrity or authenticity of the returned bytes. This behavior exceeds the minimum privileges needed to provide diagnostic guidance. Installation documentation can instead direct users to verified packages or a download-review-verify workflow. ### Attack Path 1. An attacker compromises an upstream repository, release process, hosting account, CDN, DNS route, or other part of the delivery chain. 2. The attacker changes the response returned by one of the installation URLs. 3. A user follows the Skill's troubleshooting instructions. 4. `curl` retrieves the attacker-controlled response. 5. The shell executes the response immediately, without review or integrity validation. 6. In the ...[truncated 644 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove all instructions that pipe network responses directly into `bash` or `sh`. 2. Download scripts or packages to a local file first: ```bash curl -fL -o installer.sh https://example.invalid/versioned-installer.sh ``` 3. Pin downloads to an immutable release or commit rather than `HEAD`. 4. Verify a maintainer-published cryptographic signature or SHA-256 checksum before execution: ```bash sha256sum -c installer.sh.sha256 ``` 5. Instruct the user to inspect the downloaded script before running it. 6. Prefer trusted operating-system package repositories where possible. 7. Avoid executing remote installation scripts with `sudo`; separate unprivileged retrieval and verification from narrowly scoped privileged installation steps. ]]>
