T03 · Remote Payload Retrieval and Execution
Error
- Location
- README.md:20
- Finding
- Unpinned Remote Installation Script Executed with Root Privileges## Vulnerability Details **File Location**: `README.md`, lines 20-28 **Vulnerability Type**: Unverified remote payload retrieval and privileged execution **Risk Level**: Critical **Complete vulnerable code snippet**: ```bash curl -fsSL https://raw.githubusercontent.com/mattboston/sms-gateway/main/install.sh | sudo bash ``` ```bash curl -fsSL -o install.sh https://raw.githubusercontent.com/mattboston/sms-gateway/main/install.sh chmod +x install.sh sudo ./install.sh ``` ### Technical Analysis The documented installation procedures download `install.sh` from the mutable `main` branch of an external GitHub repository and execute it with `sudo`. Neither procedure pins the payload to an immutable commit or release, and neither verifies a cryptographic checksum or signature. The first procedure pipes the network response directly into a root shell, preventing meaningful inspection before execution. The second procedure separates download and execution but still recommends running the unverified file as root. Because the remote installer is not included in the audited artifact, its effective behavior cannot be determined from this package and can change after review. Running an installer as root may be necessary for narrowly defined operations such as installing a system service or configuring device access. However, granting unrestricted root shell execution to mutable, unverified remote content exceeds the minimum safely verifiable privilege required by the OpenClaw Skill itself. ### Attack Path 1. An attacker compromises the repository owner’s account, repository, release process, or another component capable of modifying the `main` branch. 2. The attacker replaces or modifies `install.sh` with malicious shell commands. 3. A user follows the installation instructions in `README.md`. 4. `curl` retrieves the attacker-controlled version without integrity or authenticity verification beyond transport security. 5. `sudo ...[truncated 834 chars]
- Remediation
- ## Remediation Suggestions 1. Remove the pipe-to-shell installation command. 2. Publish the installer and binary as versioned release artifacts rather than retrieving them from a mutable branch. 3. Pin downloads to an immutable release version or commit identifier. 4. Publish a SHA-256 checksum and require users to verify it before execution. 5. Prefer cryptographic release signatures with verification against a documented maintainer key. 6. Instruct users to inspect the downloaded installer before granting privileges. 7. Split privileged and unprivileged installation steps. Use `sudo` only for narrowly scoped operations that require it, such as copying a reviewed binary or creating a systemd unit. 8. Avoid allowing the installer to run an unrestricted root shell where dedicated package-management or service-management commands can accomplish the task. 9. Document the files, users, groups, device permissions, and services that installation will create or modify.
