T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:17
- Finding
- Remote Installer Executed Directly Through a Shell Pipeline<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 17 **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 command retrieves mutable content from `https://cli.inference.sh` and pipes the response directly into `sh`. The remote response is therefore executed before the user can inspect it or independently verify its integrity. Although the document claims that the installer verifies the downloaded CLI binary with SHA-256, that verification is performed by the same unverified remote script being executed. It does not protect against compromise of the installer endpoint or malicious modification of both the binary and expected checksum. HTTPS protects the connection in transit but does not protect against a compromised server, domain, deployment pipeline, or trusted certificate path. Installing the CLI is necessary for the documented functionality, but executing a mutable installer directly from the network is not the minimum-risk installation method. The same functionality can be provided using a version-pinned binary, an independently published signature or checksum, and explicit verification before execution. ### Attack Path 1. An attacker compromises the installer domain, hosting account, deployment pipeline, DNS resolution, or another trusted delivery component. 2. The attacker changes the response returned by `https://cli.inference.sh` to include malicious shell commands. 3. A user follows the documented Quick Start command. 4. `curl` retrieves the attacker-controlled response and streams it directly to `sh`. 5. The shell executes the payload with all privileges available to the invoking user. 6. The payload can access user files and credentials, alter shell configuration, download additional malware, or establish persistence. 7. If the user invokes the command from a privi ...[truncated 875 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the `curl | sh` installation pattern. 2. Direct users to a version-specific release artifact rather than a mutable installer endpoint. 3. Publish SHA-256 checksums through an independently controlled and authenticated release channel. 4. Prefer cryptographic signatures using a documented, pinned signing key. Verify both the signature and signer identity before installation. 5. Show separate download, verification, and installation commands so users can inspect the artifact before execution. 6. Pin the expected CLI version and avoid URLs that silently resolve to the latest release. 7. Explicitly warn users not to run the installation as root or through `sudo`. 8. Consider distributing the CLI through a reputable package manager that supports signed and versioned packages. A safer documented workflow should follow this pattern: ```bash # Example structure; replace placeholders with a pinned release and verified digest. curl -fSLo infsh "https://dist.inference.sh/cli/releases/<PINNED_VERSION>/infsh-<OS>-<ARCH>" echo "<EXPECTED_SHA256> infsh" | sha256sum --check - chmod 0755 infsh install -m 0755 infsh "$HOME/.local/bin/infsh" infsh login ``` The expected checksum must not be retrieved solely from the same mutable endpoint as the artifact during installation. ]]>
