Description
The "go tool pack" subcommand (usually used only by the compiler as an internal tool with known-good inputs) does not sanitize output filenames. Extracting a malicious archive file with the "pack" subcommand can write files to arbitrary locations on the filesystem.
Published: 2026-05-07
Score: n/a
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability arises in the "go tool pack" subcommand, part of the Go toolchain. The subcommand concatenates the filenames contained in a malicious archive without performing path sanitization, allowing an archive such as ../../../../etc/passwd to be extracted to an arbitrary location. When an attacker supplies such an archive to the subcommand, the tool writes or overwrites files anywhere the executing user has permission to. Because this subcommand is normally invoked by the compiler with known‑good inputs, the presence of unsanitized filenames can be exploited by injecting malicious archives into build sources or package repositories. The resulting arbitrary file creation or overwrite can lead to code execution, privilege escalation, or denial of service. This weakness is a classic path‑traversal or unsanitized input flaw, commonly identified as CWE‑22 or CWE‑73.

Affected Systems

The affected product is the Go toolchain, specifically the cmd/go executable. No specific version range is supplied in the advisory; therefore any installation of the Go compiler that includes the pack subcommand may be impacted until the fix is released.

Risk and Exploitability

No EPSS score is available and the flaw is not listed in the CISA KEV catalog, indicating no reported active exploitation. Nevertheless, the flaw permits local, arbitrary file write, which is a high‑severity risk when build tools are exposed to untrusted input. An attacker with the ability to run "go tool pack" and supply a crafted archive can overwrite system or application files, potentially enabling further compromise. The exploitation path requires local execution and a malicious archive; remote exploitation is not possible via network alone. The lack of a known exploit reduces immediate threat, but the potential impact for vulnerable environments remains significant.

Generated by OpenCVE AI on May 7, 2026 at 21:22 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Install the updated Go toolchain that includes the path‑sanitization fix for the pack subcommand.
  • If updating is not feasible, limit or disable the use of "go tool pack" for untrusted build processes.
  • Sanitize archive filenames by rejecting any path components that could resolve to parent directories before extraction.
  • Monitor for unexpected file creation or overwriting in directories processed by the toolchain.

Generated by OpenCVE AI on May 7, 2026 at 21:22 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 07 May 2026 21:45:00 +0000

Type Values Removed Values Added
Weaknesses CWE-22
CWE-73

Thu, 07 May 2026 20:00:00 +0000

Type Values Removed Values Added
Description The "go tool pack" subcommand (usually used only by the compiler as an internal tool with known-good inputs) does not sanitize output filenames. Extracting a malicious archive file with the "pack" subcommand can write files to arbitrary locations on the filesystem.
Title Invoking "go tool pack" does not sanitize output paths in cmd/go
References

Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: Go

Published:

Updated: 2026-05-07T19:41:18.993Z

Reserved: 2026-04-07T18:13:03.524Z

Link: CVE-2026-39817

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-05-07T20:16:42.983

Modified: 2026-05-07T20:38:04.860

Link: CVE-2026-39817

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-05-07T21:30:25Z

Weaknesses