T03 · Remote Payload Retrieval and Execution
Warning
- Location
- scripts/setup.sh:87
- Finding
- Unverified Remote Installer Piped Directly to a Shell<![CDATA[ ## Vulnerability Details **File Location**: `scripts/setup.sh:87-92` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: Medium ### Vulnerable Code ```bash if command -v solana-keygen &>/dev/null; then info "solana-cli found ($(solana-keygen --version 2>/dev/null | head -1))" else warn "solana-cli not found (optional — only needed for local key generation)" echo " → Install: sh -c \"\$(curl -sSfL https://release.anza.xyz/stable/install)\"" fi ``` ### Technical Analysis The setup script recommends downloading the response from a mutable `stable` URL and passing it directly to `sh`. The retrieved content is not pinned to a reviewed release and is not authenticated with a publisher signature or expected checksum. The command is printed rather than executed automatically, so exploitation requires the user to follow the displayed installation instruction. Nevertheless, it forms part of the Skill's intended setup flow and creates a remote code-execution channel whose effective payload can change after the Skill has been audited. TLS protects transport under normal circumstances but does not protect against compromise of the distribution service, its deployment pipeline, DNS or certificate trust infrastructure, or the upstream publisher account. ### Attack Path 1. The user runs `scripts/setup.sh` on a system without `solana-keygen`. 2. The script displays the `curl | sh` installation command as its recommended remediation. 3. The remote `stable/install` endpoint or its delivery infrastructure is compromised, or begins serving an unsafe installer. 4. The user copies and executes the displayed command. 5. The remote response is interpreted immediately by the local shell without review or integrity validation. 6. The payload executes with all permissions held by that user. ### Impact Assessment Successful exploitation permits arbitrary command execution under the invoking user's account. The payload could access user ...[truncated 396 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace the mutable `stable` installer with an explicitly pinned release. 2. Download the artifact to a local file instead of piping it directly to a shell. 3. Verify a publisher-signed release signature or a checksum obtained through an independently authenticated channel. 4. Display the resolved version and verification result before execution. 5. Allow the user to inspect the downloaded installer before running it. 6. Prefer a trusted package repository or reproducible package manager installation when available. A hardened flow should follow this pattern: ```bash curl --fail --location --output installer.sh "<pinned-release-url>" echo "<expected-sha256> installer.sh" | sha256sum --check - less installer.sh sh installer.sh ``` The checksum must be updated through a controlled review process rather than retrieved from the same mutable endpoint as the installer. ]]>
