T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/install-tools.sh:25
- Finding
- Mutable remote installer content is recommended for direct shell execution<![CDATA[ ## Vulnerability Details **File Location**: `scripts/install-tools.sh:25-30`, `scripts/install-tools.sh:47-63` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High ### Vulnerable Code ```bash # --- Forge check --- if command -v forge &>/dev/null; then echo "✅ Forge already installed: $(forge --version 2>&1 | head -1)" else echo "⚠️ Forge not found. Install via: curl -L https://foundry.paradigm.xyz | bash && foundryup" fi ``` ```bash # --- Aderyn --- if command -v aderyn &>/dev/null; then echo "✅ Aderyn already installed: $(aderyn --version 2>&1 | head -1)" else echo "📦 Installing Aderyn..." if command -v cargo &>/dev/null; then cargo install aderyn elif [ -f "$HOME/.cargo/env" ]; then source "$HOME/.cargo/env" cargo install aderyn else echo "⚠️ Rust/cargo not found. Install Rust first:" echo " curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" echo " source ~/.cargo/env && cargo install aderyn" fi fi ``` ### Technical Analysis The script does not automatically execute the two `curl | shell` pipelines; it prints them as installation instructions when Foundry or Rust is unavailable. Nevertheless, following those instructions passes mutable network responses directly to a command interpreter without first verifying a pinned version, cryptographic signature, or checksum. HTTPS protects the connection in transit but does not establish that the returned script is immutable or that a compromised upstream host cannot deliver a malicious response. The effective payload can change after the Skill package has been reviewed. The Foundry command also does not restrict the protocol and minimum TLS version as the Rust command does, although such restrictions would not eliminate the underlying pipe-to-shell risk. This behavior is not necessary for the Skill's core auditing function. Tools can be installed from pinned, indep ...[truncated 1281 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove all pipe-to-shell installation recommendations. 2. Pin exact Foundry and Rust toolchain versions that have been reviewed. 3. Download release artifacts to a temporary file rather than executing streamed responses. 4. Verify artifacts using a publisher signature or an independently pinned SHA-256 checksum. 5. Display the artifact source, expected version, and checksum before installation. 6. Require explicit user approval before executing any downloaded file. 7. Prefer a prebuilt, reproducible audit container containing the required pinned tools. 8. If a required tool is unavailable, continue with partial analysis rather than encouraging immediate remote execution. A safer conceptual workflow is: ```bash curl --proto '=https' --tlsv1.2 --fail --location \ --output /tmp/pinned-installer.sh \ 'https://trusted.example/releases/exact-version/installer.sh' printf '%s %s\n' "$EXPECTED_SHA256" /tmp/pinned-installer.sh | sha256sum --check - less /tmp/pinned-installer.sh bash /tmp/pinned-installer.sh ``` The expected checksum must be pinned in reviewed code or obtained through a separately authenticated channel, not fetched from the same mutable endpoint as the artifact. ]]>
