T03 · Remote Payload Retrieval and Execution
- Location
- SKILL.md:17
- Finding
- Mutable Remote Installer Is Executed Directly Through the Shell<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:17` **Vulnerability Type**: Remote payload retrieval and immediate execution **Risk Level**: Critical ### Vulnerable Code ```bash # Install CLI curl -fsSL https://cli.inference.sh | sh && infsh login ``` ### Technical Analysis The installation command downloads a shell script from a mutable external URL and sends the response directly to `sh`. The effective code being executed is therefore not contained in the audited project and can change after the Skill has been reviewed. Although `SKILL.md:23` states that the installer verifies the checksum of a subsequently downloaded binary, this does not establish trust in the installer itself. The installer is executed before its contents, version, signature, or digest are independently verified. Any checksum logic inside that script can also be modified if the remote installer is compromised. HTTPS protects transport under ordinary conditions, but it does not mitigate compromise of the hosting account, web server, DNS or certificate infrastructure, deployment pipeline, or the installer itself. ### Attack Path 1. An attacker compromises `cli.inference.sh`, its deployment pipeline, or another component capable of changing the returned installer. 2. The attacker replaces or modifies the installer response with malicious shell commands. 3. A user or Agent follows the documented Quick Start command. 4. `curl` retrieves the attacker-controlled response. 5. The pipe sends the response directly to `sh` without local verification. 6. The malicious commands execute with all operating-system privileges held by the invoking user. ### Impact Assessment Successful exploitation permits arbitrary local command execution under the invoking account. Depending on that account's existing permissions, an attacker could: - Read or modify user-accessible files and credentials. - Steal authentication tokens and environment variables. - Install persistence within user- ...[truncated 431 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the direct `curl | sh` installation path. 2. Publish versioned CLI artifacts and require an explicit immutable version. 3. Download the artifact to a temporary file without executing it: ```bash curl --fail --show-error --location \ --output infsh.tar.gz \ https://dist.inference.sh/cli/releases/<fixed-version>/infsh-<platform>.tar.gz ``` 4. Verify the artifact locally against a digest embedded in the reviewed Skill rather than downloading both the artifact and expected digest from the same mutable source: ```bash printf '%s %s\n' '<reviewed-sha256>' 'infsh.tar.gz' | sha256sum --check - ``` 5. Prefer a cryptographic signature verified with a pinned, independently distributed public key. 6. Extract and install only after verification succeeds. 7. Avoid requiring elevated permissions; install into a user-controlled directory with restricted permissions. 8. Document the binary's network destinations, update behavior, credential storage, and supported manual removal procedure. ]]>
