T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:16
- Finding
- Unverified Remote Installer Executed Directly by Shell<![CDATA[ ## 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 command downloads mutable content from `https://cli.inference.sh` and pipes it directly into `sh`. The downloaded script is therefore executed before the user can inspect it or independently verify its integrity. The documentation states that the installer verifies the SHA-256 checksum of the binary it subsequently downloads. That does not establish the integrity of the installer itself: a compromised installer can omit or falsify verification, download another payload, or execute arbitrary commands directly. The effective code executed on the host can change after the Skill has been reviewed. Compromise of the hosting service, delivery infrastructure, or publishing credentials could consequently turn this installation command into an arbitrary-code-execution channel. Installing a CLI is relevant to the declared functionality, but piping an unpinned remote script directly into a shell is not the minimum-risk method required to perform that installation. ### Attack Path 1. An attacker compromises the remote installer, its hosting infrastructure, or credentials authorized to publish content at `cli.inference.sh`. 2. The attacker modifies the returned shell script to include malicious commands. 3. A user or agent follows the documented quick-start command. 4. `curl` retrieves the attacker-controlled content and immediately passes it to `sh`. 5. The malicious commands execute with the privileges of the account running the installation. 6. The payload can access files, environment variables, credentials, and network resources available to that account. It may also tamper with the installed `infsh` binary or intercept the subsequent `infsh login` operation. ### Impact Assessment ...[truncated 831 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Remove the `curl | sh` installation pattern. - Pin the CLI to a specific immutable version. - Provide separate download, verification, and execution steps so the artifact can be inspected before use. - Publish checksums and preferably cryptographic signatures through an independently protected channel. - Require verification of the downloaded artifact before execution, for example: ```bash curl -fSLO https://dist.inference.sh/cli/<version>/infsh-<platform> curl -fSLO https://dist.inference.sh/cli/<version>/checksums.txt sha256sum --check checksums.txt --ignore-missing install -m 0755 infsh-<platform> "$HOME/.local/bin/infsh" infsh login ``` - Ensure the real artifact URL, filename, and verification procedure are documented precisely. - Avoid requesting elevated privileges and install into a user-controlled directory unless system-wide installation is explicitly necessary. - Sign release artifacts and document signature verification using a pinned public key. - Keep installation and authentication as separate operations so users can verify the installed executable before providing credentials. ]]>
