T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/setup.sh:88
- Finding
- Mutable Remote Installation Script Recommended for Direct Shell Execution<![CDATA[ ## Vulnerability Details **File Location**: `scripts/setup.sh:88` **Vulnerability Type**: Remote code retrieval and execution through a `curl`-to-shell command **Risk Level**: High ### Vulnerable Code ```bash echo " → Install: sh -c \"\$(curl -sSfL https://release.anza.xyz/stable/install)\"" ``` ### Technical Analysis The setup script recommends downloading a shell script from an external URL and passing its contents directly to `sh`. Although `setup.sh` only prints this command rather than executing it automatically, it presents the command as the supported installation procedure. The effective code executed by the user is not included in the audited package. It is also not pinned to a specific immutable release, checksum, or cryptographic signature. The remote payload can therefore change after the Skill has been reviewed. HTTPS protects data in transit but does not establish that the response is the same artifact that was reviewed. A compromise of the release infrastructure, domain, DNS resolution, TLS trust chain, or upstream publishing credentials could replace the response with arbitrary shell code. ### Attack Path 1. The user runs `scripts/setup.sh`. 2. The script reports that `solana-cli` is unavailable and displays the installation command. 3. The user copies and executes the recommended command. 4. The command retrieves the current response from `https://release.anza.xyz/stable/install`. 5. If the response or delivery infrastructure has been compromised, attacker-controlled shell code is passed directly to `sh`. 6. The payload executes with the privileges and environment of the invoking user and can modify user-owned files, steal accessible credentials, or establish persistence. ### Impact Assessment Successful exploitation provides arbitrary code execution under the account that runs the recommended command. The payload could access the user's SSH configuration and other user-readable credentials, modify shell startup files, tampe ...[truncated 227 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Do not recommend piping network responses directly into a shell. - Pin the installation to a specific, reviewed release rather than a mutable `stable` endpoint. - Download the artifact to a local file before execution. - Verify a cryptographic signature or a checksum obtained through an independently authenticated channel. - Display the resolved version, source URL, and expected digest to the user. - Require explicit confirmation before executing any downloaded installer. - Prefer installation through a trusted, signed package repository when available. - Document a manual inspection procedure, for example: ```bash curl --fail --location --output solana-install.sh \ "https://example.invalid/releases/<fixed-version>/install.sh" printf '%s %s\n' "<expected-sha256>" "solana-install.sh" | sha256sum --check less solana-install.sh sh solana-install.sh ``` ]]>
