T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:18
- Finding
- Unverified Remote Installer Executed Directly by a Shell## Vulnerability Details **File Location**: `SKILL.md`, line 18 **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High **Complete Code Snippet**: ```bash # or: curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh ``` ### Technical Analysis The installation instructions retrieve a shell script from the mutable `master` branch of an external GitHub repository and pipe the response directly into `sh`. This design combines downloading and execution into one operation, preventing routine inspection before execution. The command does not pin the installer to an immutable release tag or commit and does not verify a cryptographic signature or documented checksum. Consequently, the effective payload can change after the Skill has been reviewed. HTTPS protects the connection in transit but does not establish that the current repository content is the same content that was audited. Installing the `rtk` executable is relevant to the Skill's declared token-compression functionality. However, executing mutable and unverified network content is not the minimum-risk installation mechanism. A package-manager installation is already documented as the primary alternative and offers a more controlled distribution path. ### Attack Path 1. An attacker compromises the upstream repository, a maintainer account, or another component of the content-delivery trust chain. 2. The attacker modifies `install.sh` on the referenced `master` branch. 3. A user or agent follows the alternative installation instruction in `SKILL.md`. 4. `curl` retrieves the current attacker-controlled response. 5. The pipe sends that response directly to `sh` without integrity verification or prior inspection. 6. The malicious installer executes with all permissions available to the invoking user. ### Impact Assessment Successful exploitation permits arbitrary command execution under the invoking user ...[truncated 720 chars]
- Remediation
- ## Remediation Suggestions 1. Remove the `curl | sh` installation pipeline and retain the documented package-manager installation as the preferred method. 2. If a standalone installer is necessary, reference an immutable release artifact, signed tag, or full commit identifier rather than the mutable `master` branch. 3. Download the artifact to a local file instead of executing streamed network content. 4. Publish a SHA-256 checksum through an independently controlled or signed release channel and verify it before execution. 5. Prefer cryptographic signature verification using a documented publisher key where supported. 6. Allow users to inspect the downloaded script before running it. 7. Execute the installer with ordinary user privileges and clearly document any filesystem changes or exceptional permissions it requires. 8. Pin the installed `rtk` version so future upstream changes do not silently alter the reviewed behavior. A safer installation pattern is: ```bash curl -fL -o install.sh "https://raw.githubusercontent.com/rtk-ai/rtk/<immutable-commit>/install.sh" printf '%s %s\n' '<documented-sha256>' 'install.sh' | sha256sum -c - less install.sh sh install.sh ```
