T03 · Remote Payload Retrieval and Execution
Error
- Location
- docs/OLLAMA_SETUP.md:16
- Finding
- Unverified Remote Installer Is Piped Directly to a Shell<![CDATA[ ## Vulnerability Details **File Location**: `docs/OLLAMA_SETUP.md:16-18` **Vulnerability Type**: Remote payload retrieval and immediate execution **Risk Level**: Critical ### Vulnerable Code ```bash **Linux:** ```bash curl -fsSL https://ollama.com/install.sh | sh ``` ``` ### Technical Analysis The installation instructions download mutable content from a remote URL and pass it directly to `sh`. The downloaded script is neither pinned to a version nor verified using a cryptographic signature or checksum. Although the URL belongs to Ollama's official domain, direct execution still creates a remote code execution channel. The effective payload may change after this Skill has been reviewed. Compromise of the hosting service, release infrastructure, DNS resolution, or TLS trust chain could cause arbitrary commands to run with the privileges of the user following the instructions. ### Attack Path 1. A user follows the Linux installation instructions. 2. The shell establishes a connection to `ollama.com` and downloads the current `install.sh`. 3. The downloaded bytes are immediately interpreted by `sh`; there is no opportunity for inspection or integrity verification. 4. If the remote script or delivery channel has been compromised, attacker-supplied commands execute locally. 5. Those commands obtain all filesystem, process, and network privileges available to the invoking user. If the command is run through `sudo` or as root, system-wide compromise is possible. ### Impact Assessment Successful exploitation can result in arbitrary command execution, installation of persistent services, credential theft, modification of Agent files, and compromise of all data accessible to the invoking account. The scope depends on the privileges used to run the installation command. ]]>
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace the pipeline with a versioned package or release artifact. 2. Download the artifact to a local file before executing it. 3. Verify a publisher-provided cryptographic signature or pinned SHA-256 checksum. 4. Display the artifact version and source to the user and require explicit approval before installation. 5. Prefer the operating system's trusted package manager where an official package is available. 6. Document that installation should occur as an unprivileged user unless a specific step requires elevation. ]]>
