T08 · Insecure Dependencies
- Location
DESIGN.md:208- Finding
Unverified Binary Downloads Installed into a System-Wide Executable Directory
- Content
View full analysis
Vulnerability Details
File Location:
DESIGN.md:208-213
Vulnerability Type: Supply-chain exposure through unverified binary installation
Risk Level: MediumVulnerable Code
bash # ripgrep curl -LO https://github.com/BurntSushi/ripgrep/releases/download/14.1.1/ripgrep-14.1.1-x86_64-unknown-linux-musl.tar.gz tar xzf ripgrep-*.tar.gz && cp ripgrep-*/rg /usr/local/bin/ # fd curl -LO https://github.com/sharkdp/fd/releases/download/v10.2.0/fd-v10.2.0-x86_64-unknown-linux-musl.tar.gz tar xzf fd-*.tar.gz && cp fd-*/fd /usr/local/bin/Technical Analysis
The design document instructs users to download executable archives, extract them, and copy the resulting binaries into
/usr/local/binwithout verifying a cryptographic signature or pinned checksum.The URLs use HTTPS, fixed release versions, and the apparent upstream GitHub repositories. This reduces—but does not eliminate—the risk. Compromise of a release asset, publisher account, repository, or local TLS trust chain could cause an altered executable to be installed.
The wildcard expressions
ripgrep-*.tar.gz,ripgrep-*/rg,fd-*.tar.gz, andfd-*/fdintroduce an additional local substitution risk. If these commands are run in a directory containing attacker-controlled matching archives or extracted directories,tarorcpmay process an unintended artifact. The instructions also do not isolate extraction in a newly created private temporary directory.The executable script itself does not automatically perform these downloads. At
scripts/search.sh:28andscripts/search.sh:37, it only prints fixed installation URLs. Therefore, the risk arises when a user or administrator follows the installation procedure inDESIGN.md.Attack Path
- A user follows the fallback dependency-installation instructions in
DESIGN.md. - An attacker compromises an upstream release asset or causes an attacker-controlled local archive or extracted directory to match one of the wildca ...[truncated 1212 chars]
- A user follows the fallback dependency-installation instructions in
- Remediation
View remediation
Remediation Suggestions
- Prefer distribution packages from trusted, configured operating-system repositories.
- If release archives must be used, pin the expected SHA-256 digest and verify it before extraction:
bash archive="ripgrep-14.1.1-x86_64-unknown-linux-musl.tar.gz" curl --fail --location --proto '=https' --tlsv1.2 \ --output "$archive" \ "https://github.com/BurntSushi/ripgrep/releases/download/14.1.1/$archive" echo '<PINNED_SHA256> ripgrep-14.1.1-x86_64-unknown-linux-musl.tar.gz' | sha256sum --check --strict -- Verify an upstream cryptographic signature where the publisher provides one.
- Download and extract inside a newly created private directory, such as one produced by
mktemp -d, and clean it with a shell trap. - Replace every wildcard with an exact archive, directory, and binary name.
- Inspect the extracted file type and permissions before installation.
- Require explicit user approval before installing software.
- Prefer a user-owned executable directory when system-wide installation is unnecessary.
- If
/usr/local/bininstallation is required, perform only the final verified copy with the minimum necessary elevation. - Document the trusted source, exact version, checksum, expected architecture, and update procedure.
