T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/install.sh:7
- Finding
- Unverified Remote Installation Scripts Are Executed Directly by a Shell<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:15`, `scripts/install.sh:7`, and `scripts/install.sh:19` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: Critical ### Vulnerable Code `SKILL.md:15`: ```bash curl -sSL https://raw.githubusercontent.com/Polymarket/polymarket-cli/main/install.sh | sh ``` `scripts/install.sh:7`: ```bash if curl -sSL https://raw.githubusercontent.com/Polymarket/polymarket-cli/main/install.sh | sh 2>/dev/null; then ``` `scripts/install.sh:19`: ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ``` ### Technical Analysis These commands download scripts from external URLs and pass the responses directly to a shell. The downloaded content is executed before it can be inspected, and no cryptographic signature, checksum, immutable commit, or release version is verified. The Polymarket installer URL follows the mutable `main` branch. Consequently, the effective code executed by this Skill can change after the reviewed package has been published. HTTPS protects the connection in transit but does not protect against compromise of the upstream repository, hosting account, release process, or authorized publisher credentials. The Rust installer is retrieved from a recognized project domain and explicitly requires HTTPS and TLS 1.2, but it still has the same execute-before-verification weakness. This behavior exceeds the minimum privileges required for read-only market browsing and price analysis. Installation should be an explicit, independently verified prerequisite rather than an automatic remote-code execution path. ### Attack Path 1. A user or Agent follows the prerequisite instructions or runs `scripts/install.sh`. 2. The shell retrieves the current response from the external installer URL. 3. An attacker compromises the upstream repository, hosting account, publishing process, or another trusted component controlling the response. 4. The attacker replac ...[truncated 992 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove every `curl | sh` installation path from both the documentation and installer. 2. Download the installer or release artifact into a newly created temporary directory without executing it. 3. Pin the dependency to an immutable release version or commit rather than `main`. 4. Publish a SHA-256 checksum through a separately protected release channel and verify it before execution. 5. Prefer publisher-signed release artifacts and verify the signature against a bundled, trusted public key. 6. Display the selected version and source to the user and require explicit approval before installation. 7. Fail closed if signature, checksum, or version verification cannot be completed. 8. Do not recommend running installation as root. 9. Treat Rust as a documented prerequisite, or install it through the operating system's trusted package manager rather than executing an unverified bootstrap response. ]]>
