T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:16
- Finding
- Mutable Remote Installation Script Is Piped Directly Into a Shell## Vulnerability Details **File Location**: `SKILL.md`, line 16 **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High **Vulnerable code:** ```bash curl -fsSL https://cli.inference.sh | sh && infsh login ``` ### Technical Analysis The installation instruction downloads a mutable script from an external server and immediately executes it with `sh`. The package contains no local copy of the installer, expected digest, signature, or pinned release against which the downloaded script can be independently validated before execution. Although the documentation states that the installer verifies the downloaded binary's SHA-256 checksum and does not request elevated permissions, that verification is performed by the same remotely retrieved script. An attacker who controls the installer endpoint, its hosting infrastructure, or a trusted deployment account could alter both the installation behavior and any checksum source it trusts. Installation of a CLI may be necessary for the declared web-search functionality, but piping mutable network content directly into a shell exceeds the minimum execution exposure required. A manual download and independent signature or pinned-digest verification would provide the required functionality without granting an unaudited response immediate shell execution. ### Attack Path 1. An attacker compromises `cli.inference.sh`, its publishing pipeline, DNS/TLS termination, or an authorized deployment account. 2. The attacker replaces the installation response with a malicious shell script. 3. A user follows the documented quick-start command. 4. `curl` sends the response directly to `sh`, executing it without review or independent integrity validation. 5. The payload runs with all permissions of the invoking account and may modify user files, steal accessible credentials, install a substituted `infsh` executable, or establish persistence where the user has write acce ...[truncated 848 chars]
- Remediation
- ## Remediation Suggestions - Replace the `curl | sh` instruction with a version-pinned binary or package download. - Publish signed release artifacts and verify them using a trusted public key distributed separately from the download endpoint. - Provide a hardcoded SHA-256 digest for each pinned platform artifact. Do not retrieve both the artifact and its authoritative digest from the same mutable deployment path. - Download into a temporary file first, verify its signature or pinned digest, and only then install it: ```bash curl -fL --proto '=https' --tlsv1.2 -o infsh \ 'https://dist.inference.sh/cli/releases/<pinned-version>/infsh-<platform>' printf '%s %s\n' '<pinned-sha256>' infsh | sha256sum -c - install -m 0755 infsh "$HOME/.local/bin/infsh" ``` - Keep installation and authentication as separate, explicit steps so users can inspect the installed binary before providing credentials. - If an installer script remains available, pin its version and digest, publish its source in the reviewed package, and instruct users to inspect and verify it before execution. - Clearly warn users not to run installation commands as root or through `sudo`.
