T03 · Remote Payload Retrieval and Execution
Warning
- Location
- skills/swap-execute-fast/scripts/execute-swap.sh:57
- Finding
- Unverified Remote Installer Piped Directly to Bash<![CDATA[ ## Vulnerability Details **File Location**: `skills/swap-execute-fast/scripts/execute-swap.sh:57-62` **Vulnerability Type**: Remote mutable payload execution through `curl | bash` **Risk Level**: Medium ### Vulnerable Code ```bash if ! command -v cast &> /dev/null; then echo "Foundry 'cast' command not found. Please install Foundry:" echo " curl -L https://foundry.paradigm.xyz | bash" echo " foundryup" exit 1 fi ``` ### Technical Analysis When the `cast` command is unavailable, the script recommends piping the response from a remote URL directly into Bash. The command is displayed rather than automatically executed, so exploitation requires the user or an agent to follow the instruction. Nevertheless, it creates a remote code-execution channel whose effective payload can change after this Skill has been audited. The installer is not pinned to a version, saved for review, or verified using a checksum or cryptographic signature. HTTPS reduces passive interception risk but does not protect against compromise of the remote origin, account, hosting infrastructure, DNS resolution, or certificate trust chain. Installing Foundry is relevant to the Skill's declared functionality, but executing a mutable remote response without verification exceeds the minimum privilege and supply-chain exposure necessary to install that dependency safely. ### Attack Path 1. The user invokes `execute-swap.sh` on a system where `cast` is missing. 2. The script prints the `curl -L ... | bash` installation command. 3. The user or an automated agent follows the displayed instruction. 4. The remote origin, redirect destination, or delivery infrastructure returns modified shell code. 5. Bash immediately executes the response without local review or integrity verification. 6. The payload runs with all privileges of the invoking user. ### Impact Assessment A malicious installer could execute arbitrary commands under the user's account, read or alter local ...[truncated 314 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace the `curl | bash` instruction with a link to the official installation documentation. 2. Prefer a package-manager installation or a version-pinned release artifact. 3. If scripted installation is necessary: - Download the artifact to a local file. - Require an explicit version. - Verify a publisher-provided cryptographic signature or pinned SHA-256 checksum. - Display the source and destination before execution. - Require explicit user approval after verification. 4. Do not follow unbounded redirects when retrieving executable content. 5. Document the expected publisher identity, version, checksum source, and verification procedure. ]]>
