T03 · Remote Payload Retrieval and Execution
Error
- Location
- references/setup.md:10
- Finding
- Remote Installer Is Downloaded and Executed Without Integrity Verification<![CDATA[ ## Vulnerability Details **File Location**: `references/setup.md:10` **Vulnerability Type**: Remote payload retrieval and immediate shell execution **Risk Level**: Critical ### Vulnerable Code ```bash # macOS/Linux sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)" ``` ### Technical Analysis The setup instructions download content from a remote URL and pass the response directly to `sh`. The effective code executed on the user's system is therefore not contained in, pinned by, or reviewable from this Skill package. No release version, cryptographic checksum, or publisher signature is specified. HTTPS protects the connection in transit under normal circumstances, but it does not protect users if the distribution endpoint, publisher account, DNS infrastructure, certificate authority, or hosted installer is compromised. Executing a mutable remote response is not the minimum privilege necessary to install the Solana CLI. A release artifact can instead be downloaded, authenticated, inspected, and then executed separately. ### Attack Path 1. An attacker compromises the remote distribution endpoint or redirects requests to it. 2. The attacker replaces the legitimate installer response with a malicious shell payload. 3. A user follows the documented setup command. 4. `curl` downloads the attacker's current payload. 5. Command substitution supplies that payload directly to `sh`. 6. The payload executes with all permissions available to the user running the command. 7. It may read wallet files, environment variables, credentials, project files, or install additional persistence. ### Impact Assessment Successful exploitation provides arbitrary command execution with the invoking user's privileges. In the documented environment, this may expose Solana wallet keypair files and other credentials and may permit unauthorized transaction signing if the relevant keys are accessible. The payload could also alter local source code, install persisten ...[truncated 53 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the command that executes a network response directly. 2. Pin installation instructions to a specific, reviewed Solana CLI release. 3. Download the release artifact to a local file without executing it. 4. Verify a hardcoded SHA-256 or stronger checksum obtained through an authenticated release channel. 5. Verify the publisher's cryptographic signature where supported. 6. Instruct users to inspect the downloaded installer before running it. 7. Run installation with ordinary user privileges and avoid `sudo` unless a specific step demonstrably requires it. 8. Document the expected artifact name, version, checksum, and signature-verification procedure. A safer workflow should follow this pattern: ```bash curl -fL -o solana-installer '<version-pinned-release-URL>' echo '<reviewed-sha256> solana-installer' | sha256sum --check - # Verify the publisher signature as well, if available. less solana-installer sh solana-installer ``` ]]>
