T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:25
- Finding
- Unpinned Remote Installation Script Is Executed Directly by a Shell<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:25` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High ### Vulnerable Code ```bash curl -sSf https://toq.dev/install.sh | sh && export PATH="$HOME/.toq/bin:$PATH" ``` ### Technical Analysis The installation procedure downloads a mutable script from an external URL and pipes the response directly into `sh`. The downloaded content is not pinned to a release, reviewed before execution, or verified using a cryptographic signature or checksum. Although HTTPS protects the connection against many network attackers, it does not ensure that the server, DNS configuration, hosting account, TLS credentials, or future contents of `install.sh` remain trustworthy. Consequently, the effective code executed by this Skill can change after the Skill itself has been audited. Direct shell execution is not the minimum behavior necessary to install the tool because the documentation already provides Homebrew as an alternative installation method. ### Attack Path 1. An attacker compromises `toq.dev`, its hosting infrastructure, DNS configuration, deployment pipeline, or installation script. 2. The attacker modifies `https://toq.dev/install.sh` to contain a malicious payload. 3. A user follows the Skill's installation instructions. 4. `curl` retrieves the attacker-controlled response and passes it directly to `sh`. 5. The payload executes with the privileges of the user running the command. 6. The payload can modify user files, steal user-accessible credentials, install additional persistence, or download further components. ### Impact Assessment Successful exploitation provides arbitrary command execution under the invoking user's account. This can expose all files, credentials, tokens, agent configuration, and communication data accessible to that account. It can also modify shell initialization files and user-level startup configuration. If the installation command is run fro ...[truncated 168 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the `curl | sh` installation pattern. 2. Direct users to a trusted package manager or a versioned release hosted in an authenticated official repository. 3. Pin the installation artifact to a specific version. 4. Publish a SHA-256 digest and a cryptographic signature for every release. 5. Download and verify the artifact before executing or installing it, for example: ```bash curl -fSLo toq.tar.gz "https://example.invalid/releases/toq-VERSION.tar.gz" echo "EXPECTED_SHA256 toq.tar.gz" | sha256sum --check - ``` 6. Verify signatures against a documented, independently distributed release key. 7. Avoid requesting administrative privileges unless the selected installation destination specifically requires them. 8. Document how users can inspect the downloaded artifact and remove the installed files. ]]>
