T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/setup.sh:87
- Finding
- Unverified Remote Installer Recommended for Direct Shell Execution<![CDATA[ ## Vulnerability Details **File Location**: `scripts/setup.sh:87` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High ### Vulnerable Code ```bash 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 a command that retrieves content from an external URL and immediately supplies the response to `sh`. The retrieved payload is not pinned to a specific version and is not validated using a cryptographic checksum or publisher signature. The command is printed rather than automatically executed, so exploitation requires the user or agent to follow the displayed instruction. Nevertheless, it creates a remote code-execution channel whose effective payload can change after the Skill has been reviewed. HTTPS protects the connection in transit but does not ensure that the remote server, release infrastructure, or delivered script remains trustworthy and immutable. ### Attack Path 1. A user runs `scripts/setup.sh` on a system without `solana-keygen`. 2. The script recommends the `sh -c "$(curl ...)"` installation command. 3. The user or AI agent follows the recommendation. 4. The remote endpoint, its DNS path, hosting infrastructure, or release account has been compromised, or the hosted script has otherwise changed. 5. The returned content is executed directly by the local shell without integrity validation. 6. The payload performs arbitrary actions with the privileges of the invoking account. ### Impact Assessment Successful exploitation permits arbitrary command execution under the account that runs the recommended installer. The payload could read user-accessible SSH credentials and validator configuration, modify shell initialization files, replace command-line tools, or establish persistence within the user account. If the recommendation is ex ...[truncated 189 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Do not recommend piping or substituting remotely retrieved content directly into a shell. - Pin the Solana CLI installer or package to an explicitly tested version. - Download the artifact to a local file before execution. - Verify a publisher-provided cryptographic signature and a pinned SHA-256 or stronger checksum. - Abort installation if verification fails. - Display the resolved version, source URL, checksum, and installation actions before requesting user approval. - Prefer a trusted package repository or signed release archive over a mutable bootstrap script. - If a bootstrap script is unavoidable, allow the user to inspect it before invoking it in a restricted environment. ]]>
