T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:53
- Finding
- Unverified Remote Script Is Piped Directly into Bash<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 53 **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High ### Vulnerable Code ```bash # Foundry (forge, cast, anvil) — for testing and gas snapshots curl -L https://foundry.paradigm.xyz | bash && foundryup ``` ### Technical Analysis The installation command downloads mutable content from an external URL and immediately executes it with Bash. It does not pin an installer version, validate a cryptographic checksum or publisher signature, or provide an opportunity to inspect the downloaded script before execution. Although Foundry is relevant to the declared Solidity audit workflow, executing an unverified network response is not necessary to provide that functionality and violates least-privilege and secure supply-chain principles. The effective payload can change after the Skill has been reviewed. The subsequent `foundryup` command may also retrieve and install additional remote artifacts. The use of HTTPS protects the connection under normal circumstances but does not protect against compromise of the hosting service, publishing infrastructure, domain, certificate authority, or upstream release process. ### Attack Path 1. An attacker compromises the remote installer endpoint, its publishing infrastructure, or another trusted part of the delivery chain. 2. The user follows the documented setup instructions. 3. `curl -L` retrieves attacker-controlled shell instructions, including content reached through HTTP redirects. 4. The pipe sends the response directly to Bash without integrity or authenticity verification. 5. Bash executes the payload with all permissions available to the invoking user. 6. The payload can access the Solidity repository, user files, environment variables, credentials, wallet-related files, and available network resources. It could also install persistence or download additional components. ### Impact Assessment Successful exploitat ...[truncated 658 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Do not pipe a network response directly into a shell. 2. Pin Foundry to a specifically reviewed release rather than installing an implicitly current version. 3. Download the release artifact and its signature or checksum as separate files. 4. Verify the artifact using a trusted publisher signature or an independently obtained SHA-256 checksum before execution. 5. Inspect the installer or use a documented package-manager installation method with release provenance verification. 6. Run installation as an unprivileged user in an isolated development environment or container. 7. Document the expected domains, artifact names, version, checksum, and verification commands. A safer conceptual workflow is: ```bash curl --fail --show-error --location \ --output foundry-installer.sh \ "https://trusted.example/path/to/pinned/foundry-installer.sh" printf '%s %s\n' '<reviewed-sha256>' 'foundry-installer.sh' | sha256sum --check - less foundry-installer.sh bash foundry-installer.sh ``` The project should replace the placeholders with a publisher-documented, version-specific artifact and an independently trusted checksum or signature. ]]>
