T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:33
- Finding
- Unpinned Remote Installation Script Executed Directly by Shell<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:33` **Vulnerability Type**: T03: Remote Payload Retrieval and Execution **Risk Level**: Critical **Vulnerable Code**: ```bash curl -sSL https://raw.githubusercontent.com/Polymarket/polymarket-cli/main/install.sh | sh ``` ### Technical Analysis This instruction downloads a shell script from the mutable `main` branch of an external GitHub repository and immediately executes it. The payload is not pinned to an immutable commit or release, and the command performs no checksum or digital-signature verification. Even though the URL refers to the stated Polymarket organization, the effective code can change after this Skill has been reviewed. Compromise of the upstream repository, maintainer account, release process, or network trust chain could therefore turn the installation command into an arbitrary-code execution mechanism. Piping directly into `sh` also prevents meaningful inspection before execution. This behavior is not necessary for the declared functionality because the document already provides Homebrew and source-build installation methods. ### Attack Path 1. An attacker compromises the upstream repository, a maintainer account, or the branch publication process. 2. The attacker modifies `install.sh` on the mutable `main` branch. 3. A user or Agent follows the installation instruction in `SKILL.md`. 4. `curl` retrieves the attacker-controlled script. 5. The pipe passes the response directly to `sh` without review or integrity verification. 6. The script executes arbitrary commands with the privileges of the invoking user. 7. The payload could inspect wallet-related files or environment variables, modify user files, install additional software, or initiate unauthorized network activity. ### Impact Assessment Successful exploitation provides arbitrary command execution under the invoking user's account. The resulting scope includes files, credentials, environment variables, and applicatio ...[truncated 388 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the direct `curl | sh` installation method. 2. Prefer installation from a versioned package-manager release. 3. If a script-based installation must remain: - Pin the URL to an immutable reviewed commit or versioned release. - Download the script to a local file without executing it. - Verify a publisher-provided cryptographic signature or a trusted, hardcoded SHA-256 checksum. - Review the downloaded script before execution. - Execute it as an unprivileged user. 4. Document the expected files, network endpoints, and permissions used by the installer. 5. Avoid silent curl options for security-sensitive installation flows so retrieval and verification failures remain visible. A safer pattern is: ```bash curl -fL -o install.sh "https://raw.githubusercontent.com/Polymarket/polymarket-cli/<IMMUTABLE_COMMIT>/install.sh" echo "<TRUSTED_SHA256> install.sh" | sha256sum -c - less install.sh sh install.sh ``` ]]>
