Skip to content

cmd/go: go tool pack does not sanitize output paths #78778

@neild

Description

@neild

The "go tool pack" subcommand is a minimal version of the Unix ar utility.
It is used by the compiler as an internal tool with known-good inputs.

The "pack" subcommand did not sanitize output filenames.
When invoked to extract a malicious archive file, it could write
files to arbitrary locations on the filesystem.

The "pack" subcommand now refuses to extract files with names
containing any directory components.

Thanks to Harshit Gupta (Mr HAX) for reporting this issue.

This is CVE-2026-39817 and Go issue https://go.dev/issue/78778.


This was a PUBLIC track issue, tracked in http://b/499265616.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.GoCommandcmd/goNeedsFixThe path to resolution is known, but the work has not been done.Security

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions