T08 · Insecure Dependencies
Warning
- Location
- references/pget.md:5
- Finding
- Unverified Installation of a Mutable Precompiled Binary## Vulnerability Details **File Location**: `references/pget.md`, lines 5–8 **Vulnerability Type**: Supply-chain risk from an unpinned and unverified executable dependency **Risk Level**: Medium ### Vulnerable Code ```bash # Linux/macOS binary: sudo curl -o /usr/local/bin/pget -L "https://github.com/replicate/pget/releases/latest/download/pget_$(uname -s)_$(uname -m)" sudo chmod +x /usr/local/bin/pget ``` ### Technical Analysis The installation instructions retrieve a precompiled executable from GitHub's mutable `latest` release URL and place it directly in the privileged `/usr/local/bin` directory. They neither pin an immutable release version nor verify the downloaded artifact using a cryptographic checksum or signature. Consequently, the code reviewed during this audit does not uniquely determine the executable that users will receive. If the upstream release account, repository, release asset, or redirect target is compromised, the same documented command could install a substituted executable. HTTPS protects transport in normal circumstances but does not establish the integrity or provenance of the release artifact itself. The command does not immediately execute the downloaded file and the documented GitHub project is not inherently malicious. Therefore, this is an insecure dependency installation process rather than evidence of an intentionally malicious payload. ### Attack Path 1. An attacker compromises the upstream repository, release workflow, maintainer credentials, or mutable `latest` release asset. 2. The attacker replaces the platform-specific `pget` artifact with a malicious executable. 3. A user follows the documented installation command. 4. `sudo curl` writes the substituted binary to `/usr/local/bin/pget`. 5. The second privileged command marks the file executable. 6. The user or an agent later invokes `pget` as directed by `SKILL.md`. 7. The substituted executable runs with the privileges of ...[truncated 780 chars]
- Remediation
- ## Remediation Suggestions 1. Pin a specific, reviewed release version rather than using the mutable `latest` URL. 2. Publish checksums through a separately protected release process and verify the selected binary before installation, for example with `sha256sum -c`. 3. Prefer signed artifacts and verify the signature against a documented, pinned maintainer key. 4. Use failure-safe download options such as `curl --fail --show-error --location`. 5. Download to a temporary file, validate it, and only then install it atomically. 6. Avoid running the network client with `sudo`. Download and verify as an unprivileged user, then use a narrowly scoped privileged installation command. 7. Prefer a user-local executable directory when system-wide installation is unnecessary. 8. Document expected artifact names, hashes, signing keys, and a procedure for securely updating pinned versions.
