T03 · Remote Payload Retrieval and Execution
Error
- Location
- references/setup.md:20
- Finding
- Remote Installer Downloaded and Executed Without Integrity Verification<![CDATA[ ## Vulnerability Details **File Locations**: - `references/setup.md:20-22` - `references/troubleshooting.md:18-22` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: Critical ### Vulnerable Code `references/setup.md:20-22`: ```bash **Fallback: Official installer (curl|sh)** ```bash curl -LsSf https://astral.sh/uv/install.sh | sh ``` ``` `references/troubleshooting.md:18-22`: ```bash ### "uvx not found" Install uvx: ```bash curl -LsSf https://astral.sh/uv/install.sh | sh ``` ``` ### Technical Analysis Both instructions pipe an HTTP response directly into the user's shell. Although the URL uses HTTPS and appears to reference the official `uv` installer, the downloaded content is mutable and is executed without: - Pinning a specific installer version or immutable artifact. - Verifying a cryptographic signature. - Comparing a pinned checksum. - Saving and inspecting the script before execution. - Restricting the installer within a sandbox. Transport encryption does not protect against compromise of the upstream domain, hosting infrastructure, publishing account, or installer itself. A compromised endpoint can return arbitrary shell commands that execute immediately with the privileges of the user following the documentation. Installing `uv` is necessary for the declared functionality, but piping mutable remote content directly into a shell is not the minimum-risk or minimum-privilege installation method. ### Attack Path 1. An attacker compromises the upstream installer endpoint, its hosting infrastructure, DNS resolution, or an authorized publishing account. 2. The attacker changes the response from `https://astral.sh/uv/install.sh` to include malicious shell commands. 3. A user follows either documented installation command. 4. `curl` downloads the attacker-controlled response. 5. The pipe sends the response directly to `sh` without an opportunity for validation. 6. The payload executes with the invoking user's per ...[truncated 728 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove all `curl | sh` installation instructions. 2. Prefer trusted system package managers, such as the already documented Homebrew method: ```bash brew install uv ``` 3. If a standalone installer is required: - Select a fixed, immutable release. - Download it to a local file without executing it. - Verify a publisher signature or a SHA-256 checksum obtained through a trusted channel. - Inspect the downloaded artifact before execution. - Execute it only after verification. 4. Document installation in a non-privileged user context and discourage unnecessary use of `sudo`. 5. Apply the remediation consistently to both `references/setup.md` and `references/troubleshooting.md`. ]]>
