T08 · Insecure Dependencies
- Location
references/installation.md:9- Finding
Unverified Third-Party Executable Installation with Elevated System-Wide Placement
- Content
View full analysis
- Remediation
View remediation
' "$tmpdir/promql.tar.gz" | sha256sum --check - ``` On macOS, use `shasum -a 256` where appropriate. Prefer a cryptographic release signature or provenance attestation when upstream provides one. 3. Stop installation on download or verification failure. Use strict shell handling such as `set -euo pipefail` in any installation script. 4. Inspect archive contents before extraction and reject absolute paths, parent-directory traversal entries, unexpected files, links, or device nodes: ```bash tar tzf "$tmpdir/promql.tar.gz" ``` 5. Extract into the isolated temporary directory, confirm that the expected file is a regular executable, and only then install it. 6. Prefer a user-owned destination such as `~/.local/bin` or `$(go env GOPATH)/bin`. Only offer `/usr/local/bin` as an explicit optional system-wide installation requiring informed user approval. 7. Replace mutable references with immutable reviewed versions: - Use a specific tagged Go module version rather than `@latest`. - Check out and verify a specific tag or commit when building from source. - Ensure installation metadata and documentation reference the same reviewed release. 8. Document the upstream trust boundary and instruct users to compare checksums against a separately authenticated source before executing the binary. ]]>
