T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:19
- Finding
- Unverified Remote Installer Is Executed Directly by a Shell<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 19 **Vulnerability Type**: Remote payload retrieval and immediate execution **Risk Level**: Critical ### Vulnerable Code ```bash # Install Ollama on Ubuntu curl -fsSL https://ollama.ai/install.sh | sh ``` ### Technical Analysis The installation command streams content from an external URL directly into a shell. The downloaded script is neither version-pinned nor independently inspected, and no cryptographic checksum or publisher signature is verified before execution. Although HTTPS protects the connection against ordinary transit modification, it does not protect users if the upstream website, hosting infrastructure, DNS/CA trust chain, or installer itself is compromised. Because the remote content is retrieved at execution time, its effective behavior can change after the Skill has been reviewed. Piping the response directly to `sh` also eliminates the natural review boundary that would exist if the installer were downloaded and examined before execution. ### Attack Path 1. An attacker compromises the installer URL, upstream hosting account, or relevant delivery infrastructure. 2. The attacker modifies `install.sh` to include arbitrary commands. 3. A user follows the Skill instructions and runs the documented `curl | sh` command. 4. `curl` retrieves the attacker-controlled content and immediately supplies it to the shell. 5. The payload executes with the privileges of the invoking user and may attempt to obtain additional privileges through commands such as `sudo`. 6. The malicious installer can modify files, install additional software, collect accessible data, or establish persistence. ### Impact Assessment Successful exploitation permits arbitrary command execution with the invoking user's privileges. If the installer is run from an elevated shell or successfully invokes an authorized privilege-elevation mechanism, the impact can extend to full system compromise. The affected ...[truncated 283 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Prefer an official, versioned operating-system package or a pinned release artifact. 2. Do not stream downloaded content directly into a shell. Download it to a local file first: ```bash curl --proto '=https' --tlsv1.2 -fLo install.sh \ https://ollama.ai/install.sh ``` 3. Verify a publisher-provided cryptographic signature and a checksum pinned in trusted documentation before execution. 4. Display or inspect the downloaded script before running it. 5. Require explicit user confirmation immediately before execution. 6. Run the installer with the lowest practical privileges and elevate only individual operations that require administrative access. 7. Pin the installer or package to a reviewed release rather than relying on a mutable URL. ]]>
