T03 · Remote Payload Retrieval and Execution
Error
- Location
- references/getting-started.md:39
- Finding
- Unverified Remote Installer Executed Directly by a Shell<![CDATA[ ## Vulnerability Details **File Location**: `references/getting-started.md:39-42` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High ```bash ### Install Script (macOS/Linux) ```bash curl -fsSL https://gh.io/copilot-install | bash # Custom: VERSION="v0.0.369" PREFIX="$HOME/custom" bash ``` ``` ### Technical Analysis The installation command streams mutable content from an external URL directly into Bash. The user cannot inspect the downloaded script before execution, and the command performs no checksum or signature verification. Although `gh.io` is associated with GitHub and HTTPS protects transport under ordinary conditions, neither property guarantees that the effective script remains identical to the version reviewed during this audit. A compromised redirect, hosting account, release process, DNS/TLS path, or upstream script could change the executed payload. The use of `curl -f` and `-sS` only controls HTTP error handling and output; it does not validate the script's authenticity or integrity. ### Attack Path 1. An attacker compromises or gains control over the redirected installer, its hosting location, or its release pipeline. 2. The attacker replaces the expected installer with a malicious shell script. 3. A user follows the Skill's documented installation command. 4. `curl` retrieves the modified content. 5. Bash immediately executes the content without review or integrity verification. 6. The payload acts with all privileges available to the invoking user. ### Impact Assessment The remote script can run arbitrary commands with the user's privileges. Potential impact includes modification or deletion of user files, credential theft, installation of persistent components, execution of additional payloads, and compromise of source repositories accessible to the user. The command does not include `sudo`, so root access is not obtained automatically. However, the impact remains broad for the current user a ...[truncated 84 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Prefer the official npm, Homebrew, WinGet, or signed release installation methods. - If a script is necessary, download it to a file rather than piping it into a shell. - Pin the installer or release to an immutable version. - Verify a vendor-published cryptographic signature or SHA-256 checksum before execution. - Let the user inspect the downloaded script before running it. - Execute the installer with the minimum required privileges and never recommend running it through `sudo` unless strictly necessary. - Replace the current example with a workflow similar to: ```bash curl -fL -o copilot-install.sh 'IMMUTABLE_VERSIONED_URL' echo 'EXPECTED_SHA256 copilot-install.sh' | sha256sum -c - less copilot-install.sh bash copilot-install.sh ``` ]]>
