T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:14
- Finding
- Unverified Remote Installer Piped Directly into a Shell<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 14 **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 command downloads a mutable script from `https://cli.inference.sh` and passes the response directly to `sh`. The remote content is executed before the user can inspect it or verify its integrity. The document states that the installer verifies the SHA-256 checksum of a subsequently downloaded binary. That does not establish the integrity of the initial bootstrap script: a compromised server, distribution pipeline, domain, or TLS endpoint could modify both the installation logic and any checksum it consumes. Installing the CLI may support the Skill's image-generation and research examples, but immediate remote shell execution is not the minimum access necessary. The Product Hunt guidance itself does not require local code execution, and the file already identifies manual installation and verification as an alternative. ### Attack Path 1. An attacker compromises the `cli.inference.sh` hosting environment, deployment pipeline, domain, or another component capable of changing the returned script. 2. A user or agent follows the Quick Start instructions. 3. `curl` retrieves the attacker-controlled response. 4. The pipe sends that response directly to `sh` without local inspection, version pinning, signature verification, or independent checksum validation. 5. The payload executes with all privileges available to the invoking user. 6. The payload can access user-readable credentials and files, modify writable configuration, install persistence within the user's scope, or replace the intended CLI. 7. The chained `infsh login` command is only reached if the remote script returns success; a malicious installer could instead imitate or manipulate the expected authentication process. ### Impact As ...[truncated 860 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the `curl | sh` installation pattern from the Quick Start instructions. 2. Link to a versioned release artifact rather than an unversioned installer endpoint. 3. Pin the expected release version and publish its SHA-256 digest through an independently protected channel. 4. Require users to download the artifact to a local file before execution: ```bash curl --fail --show-error --location \ --output infsh.tar.gz \ https://dist.inference.sh/cli/releases/<PINNED_VERSION>/infsh-<PLATFORM>.tar.gz printf '%s %s\n' '<EXPECTED_SHA256>' 'infsh.tar.gz' | sha256sum --check - ``` 5. Prefer cryptographic signature verification using a documented, pinned public key over an unauthenticated checksum alone. 6. Let users inspect downloaded installation scripts or binaries before installation. 7. Install only into a user-controlled directory without `sudo`, startup services, or background processes. 8. Keep installation and authentication as separate, explicit operations. Do not automatically invoke `infsh login` after running installation code. 9. Document what information the login process transmits and where credentials or tokens are stored. ]]>
