T08 · Insecure Dependencies
- Location
SKILL.md:14- Finding
Unverified Remote Go Archive Extracted into a Privileged System Directory
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 14
Vulnerability Type:T08: Insecure Dependencies
Risk Level: HighVulnerable 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/localdirectory. The command does not verify a cryptographic checksum or signature before extraction. It also follows redirects throughcurl -Land does not use--failto 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
- An attacker compromises the download endpoint, an allowed redirect destination, or another part of the artifact distribution channel.
- The attacker causes the URL to return a modified gzip-compressed tar archive.
- The installation command follows redirects and streams the response directly to
tar. tarextracts the attacker-controlled archive under/usr/localwithout checksum or signature verification.- Modified Go binaries or other archive content become available system-wide.
- 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
View 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 -cbefore 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/localunless 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.
