T08 · Insecure Dependencies
Error
- Location
- SKILL.md:14
- Finding
- Unverified Remote Go Archive Extracted into a Privileged System Directory## Vulnerability Details **File Location**: `SKILL.md`, line 14 **Vulnerability Type**: `T08: Insecure Dependencies` **Risk Level**: High **Vulnerable Code**: ```bash "script": "curl -L https://golang.org/dl/go1.21.5.linux-amd64.tar.gz | tar -C /usr/local -xzf -", ``` ### Technical Analysis The installation command downloads a remote archive and streams it directly into `tar`, which extracts its contents under the system-wide `/usr/local` directory. The command does not verify a cryptographic checksum or signature before extraction. It also follows redirects through `curl -L` and does not use `--fail` to reject HTTP error responses explicitly. This design crosses a supply-chain trust boundary: the content returned by the remote server becomes locally installed executable content without independent integrity validation. Streaming the response directly into the extraction utility also prevents inspection of the complete artifact before it modifies the filesystem. The source URL belongs to the official Go distribution domain, so this finding does not establish malicious intent. The vulnerability is the absence of controls capable of detecting a compromised distribution endpoint, redirect target, network response, or substituted archive. ### Attack Path 1. An attacker compromises the download endpoint, an allowed redirect destination, or another part of the artifact distribution channel. 2. The attacker causes the URL to return a modified gzip-compressed tar archive. 3. The installation command follows redirects and streams the response directly to `tar`. 4. `tar` extracts the attacker-controlled archive under `/usr/local` without checksum or signature verification. 5. Modified Go binaries or other archive content become available system-wide. 6. Subsequent invocations of `go`, package builds, or security-scanning workflows execute or rely on the substituted content. ### Impact Assessment Successful exploitation cou ...[truncated 754 chars]
- Remediation
- ## Remediation Suggestions - Prefer installing Go through a trusted operating-system package manager with repository signature verification. - If direct archive installation is required, download the archive to a newly created temporary directory rather than piping it directly into `tar`. - Use strict download options such as `curl --fail --show-error --location`. - Pin the expected SHA-256 digest and verify it with `sha256sum -c` before extraction. - Obtain the expected digest through an authenticated, independently trusted source rather than from the same unverified response path. - Reject the installation if integrity verification fails. - Inspect the archive file list before extraction and ensure paths cannot escape the intended destination. - Extract with the minimum permissions necessary and avoid writing to `/usr/local` unless system-wide installation is explicitly required and authorized. - Record the verified version and digest to make installation reproducible and auditable. A hardened workflow should follow this order: download to a temporary file, verify its pinned digest or trusted signature, inspect the archive, and only then extract it into an approved destination.
