T03 · Remote Payload Retrieval and Execution
Error
- Location
- data/install.md:25
- Finding
- Unpinned Remote Installer Executed Directly by a Shell## Vulnerability Details **File Location**: `data/install.md`, line 25 **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High **Vulnerable Code**: ```yaml command: "curl -fsSL https://get.x-cmd.com | sh" ``` ### Technical Analysis The auto-install metadata recommends downloading a mutable script from `https://get.x-cmd.com` and immediately piping the response into `sh`. The payload is neither version-pinned nor independently authenticated before execution. HTTPS provides transport protection but does not protect users if the hosting service, publishing account, DNS infrastructure, or delivered installer is compromised. Any checksum validation performed by the downloaded installer occurs only after that initial installer has already received arbitrary code-execution capability. Consequently, such validation cannot establish the integrity of the code passed directly to the shell. This behavior is unnecessary for the Skill's declared function of returning software installation instructions. It grants remotely supplied code the full privileges of the invoking user, exceeding the minimum access required for an installation-command lookup. ### Attack Path 1. An attacker compromises `get.x-cmd.com`, its deployment pipeline, publishing credentials, or related delivery infrastructure. 2. The attacker replaces the expected installer response with a malicious shell script. 3. The Skill or a user selects the documented automatic installation method. 4. `curl` retrieves the attacker-controlled response. 5. The pipe sends the response directly to `sh` without review, version pinning, signature verification, or pre-execution checksum validation. 6. The malicious script executes with the privileges and environment of the invoking user. ### Impact Assessment Successful exploitation provides arbitrary command execution under the invoking user's account. The payload could read or modify any user-accessi ...[truncated 443 chars]
- Remediation
- ## Remediation Suggestions Remove the direct `curl | sh` auto-install command from the metadata. Prefer installation through a trusted package manager such as Homebrew. If a standalone installer must be supported: 1. Publish immutable, versioned installer artifacts. 2. Download the installer to a local file without executing it. 3. Verify a cryptographic signature from a trusted publisher key or compare its SHA-256 digest against a value obtained through an independent trusted channel. 4. Display the script for manual review. 5. Require explicit user consent before execution. 6. Execute without elevated privileges and document all filesystem and shell-profile modifications. 7. Avoid representing post-download binary checksums as verification of the initial installer itself. A safer workflow should follow this pattern: ```sh curl -fSLo /tmp/x-cmd-install.sh "https://trusted.example/versioned/x-cmd-install.sh" printf '%s %s\n' "$EXPECTED_SHA256" /tmp/x-cmd-install.sh | sha256sum -c - less /tmp/x-cmd-install.sh sh /tmp/x-cmd-install.sh ```
