T03 · Remote Payload Retrieval and Execution
Error
- Location
- references/local-providers.md:7
- Finding
- Unverified Remote Installer Is Piped Directly into a Shell<![CDATA[ ## Vulnerability Details **File Location**: `references/local-providers.md`, lines 7-13; vulnerable command at line 12 **Vulnerability Type**: Remote payload retrieval and immediate execution **Risk Level**: High ### Vulnerable Code ```bash # macOS brew install ollama # Linux curl -fsSL https://ollama.ai/install.sh | sh ``` ### Technical Analysis The Linux installation instructions download a mutable script from an external URL and immediately pass its contents to `sh`. No release version is pinned, and no cryptographic signature or checksum is verified before execution. This pattern creates a remote code-execution channel whose effective payload can change after the Skill has been reviewed. Compromise of the referenced domain, DNS or network path, hosting infrastructure, redirect destination, or upstream installer could cause arbitrary commands to be returned and executed. Installing a supported local provider is relevant to the Skill, but direct `curl | sh` execution is not necessary for its routing and savings-tracking functionality and exceeds the minimum-risk installation mechanism. ### Attack Path 1. A user or agent follows the Linux installation instructions. 2. `curl` requests the current contents of `https://ollama.ai/install.sh`. 3. An attacker who has compromised the upstream distribution channel causes the response to contain malicious shell commands. 4. The response is passed directly to `sh` without being saved, inspected, pinned, or cryptographically verified. 5. The malicious commands execute with the privileges of the user running the command. 6. If the remote installer requests elevated privileges and the user grants them, the resulting impact may extend to system-level modification. ### Impact Assessment A malicious installer can obtain arbitrary command execution under the invoking user's account. This may permit access to that user's files, credentials, API configuration, and local model data; modification of shell or ap ...[truncated 337 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the direct `curl | sh` pipeline. 2. Prefer installation through a trusted operating-system package repository where package signatures are verified. 3. If a standalone installer is required: - Pin an explicit, reviewed release URL. - Download the installer to a local file. - Obtain the expected SHA-256 digest or signature through an authenticated, independent release channel. - Verify the digest or publisher signature before execution. - Review the script before running it. - Execute it as an unprivileged user unless a documented installation step specifically requires elevation. 4. Document every privileged operation the installer is expected to perform. 5. Fail closed if integrity or signature verification does not succeed. A safer workflow should resemble: ```bash curl -fL --output ollama-install.sh "PINNED_RELEASE_URL" echo "EXPECTED_SHA256 ollama-install.sh" | sha256sum --check - less ollama-install.sh sh ollama-install.sh ``` The checksum must come from a trusted publisher source and must be updated deliberately when upgrading the pinned release. ]]>
