T03 · Remote Payload Retrieval and Execution
Error
- Location
- references/anchor.md:25
- Finding
- Unverified Remote Installation Script Executed Directly by Bash<![CDATA[ ## Vulnerability Details **File Location**: `references/anchor.md:25-30` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: Critical ### Vulnerable Code ```bash ### Quick Install (Mac/Linux) # Install all dependencies (Rust, Solana CLI, Anchor) curl --proto '=https' --tlsv1.2 -sSfL https://solana-install.solana.workers.dev | bash ``` ### Technical Analysis The installation command retrieves mutable content from an external `workers.dev` endpoint and immediately pipes it into Bash. There is no version pinning, checksum verification, cryptographic signature validation, or opportunity to inspect the downloaded script before execution. The TLS options protect data in transit but do not guarantee that the endpoint account, deployment, or delivered script remains trustworthy. The endpoint is also not the official Anchor GitHub repository referenced elsewhere in the project. This behavior exceeds the minimum privileges required to document Anchor installation because safer package-manager and verified-release installation methods are available. ### Attack Path 1. An attacker compromises the external endpoint, its associated account, or its deployment pipeline. 2. The attacker replaces the installation response with a malicious shell script. 3. A user or AI agent follows the documented quick-install command. 4. `curl` retrieves the attacker-controlled payload. 5. Bash executes the payload immediately with the privileges of the invoking user. 6. The payload can inspect wallet files, alter development tools, tamper with build artifacts, or establish additional access. ### Impact Assessment Successful exploitation provides arbitrary command execution under the invoking user's account. Depending on the user's environment, the attacker could: - Read Solana wallet and deployment keypairs accessible to the user. - Steal RPC credentials and other development secrets. - Modify source code, toolchains, or generated deployment ar ...[truncated 339 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the direct `curl | bash` pipeline. 2. Use official, version-pinned releases from the relevant vendor repository. 3. Download the installer as a separate file and inspect it before execution. 4. Verify a vendor-published cryptographic signature or SHA-256 checksum. 5. Prefer trusted package managers where possible. 6. Document the exact expected version rather than installing a mutable latest release. 7. If a script remains necessary, use a workflow similar to: ```bash curl --proto '=https' --tlsv1.2 -fLO \ https://official.example/releases/vX.Y.Z/installer.sh echo "<EXPECTED_SHA256> installer.sh" | sha256sum --check less installer.sh bash installer.sh ``` The actual URL and checksum must come from an authenticated official release channel. ]]>
