T03 · Remote Payload Retrieval and Execution
Error
- Location
- INSTALL.md:42
- Finding
- Mutable Remote Installation Script Executed with Root Privileges<![CDATA[ ## Vulnerability Details **File Location**: `INSTALL.md:42-49` **Additional Location**: `README.md:104-112` **Vulnerability Type**: Unverified remote payload retrieval and privileged execution **Risk Level**: Critical ### Vulnerable Code ```bash # 1. Download script cd /tmp curl -fsSL https://raw.githubusercontent.com/openclaw/skills/main/ollama-updater/ollama-install.sh -o ollama-install.sh # 2. Add execution permission chmod +x ollama-install.sh # 3. Run installation sudo ./ollama-install.sh ``` The equivalent workflow is also recommended in `README.md:104-112`. ### Technical Analysis The installation instructions download a shell script from the mutable `main` branch of a GitHub repository and subsequently execute it with `sudo`. The retrieved file is not authenticated using a cryptographic signature or a pinned checksum, and the URL does not reference an immutable commit. HTTPS protects the connection in transit but does not ensure that the branch contents remain identical to the version reviewed in this audit. Compromise of the repository, maintainer account, publishing workflow, or GitHub organization could replace the script after review. Unlike a literal `curl | sh` pipeline, this workflow writes the script to disk first. However, the instructions do not require users to inspect it, and no automated integrity check occurs before execution. Its effective security properties therefore remain similar to remote shell execution. ### Attack Path 1. An attacker compromises the repository, a maintainer account, or the workflow permitted to update the `main` branch. 2. The attacker replaces `ollama-install.sh` with a malicious script while preserving the documented URL. 3. A user follows the installation instructions and retrieves the modified file. 4. The user marks the file executable and invokes it with `sudo`. 5. The attacker-controlled script executes with root privileges. 6. The payload can alter system files, install services, acces ...[truncated 626 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Prefer executing the reviewed script bundled in the installed Skill rather than downloading another copy at runtime. 2. If remote retrieval is necessary, use an immutable commit URL rather than a mutable branch: ```text https://raw.githubusercontent.com/openclaw/skills/<full-commit-id>/ollama-updater/ollama-install.sh ``` 3. Publish signed release artifacts and verify the signature before execution. 4. Publish a trusted SHA-256 digest through an independent, authenticated release channel and enforce verification: ```bash curl -fL '<immutable-url>' -o ollama-install.sh printf '%s %s\n' '<expected-sha256>' 'ollama-install.sh' | sha256sum -c - ``` 5. Abort installation if checksum or signature verification fails. 6. Require the user to inspect the downloaded script before running it. 7. Avoid running the entire installer as root. Download and validate artifacts as an unprivileged user, escalating only for narrowly scoped installation operations. 8. Replace the README example containing `curl -fsSL https://ollama.com/install.sh | sh` with a download, verification, review, and execution workflow. ]]>
