GO-2026-4339

Source
https://pkg.go.dev/vuln/GO-2026-4339
Import Source
https://vuln.go.dev/ID/GO-2026-4339.json
JSON Data
https://api.test.osv.dev/v1/vulns/GO-2026-4339
Aliases
Related
Published
2026-01-28T19:07:59Z
Modified
2026-01-31T20:26:04.867961Z
Summary
Arbitrary file write using cgo pkg-config directive in cmd/go
Details

Building a malicious file with cmd/go can cause can cause a write to an attacker-controlled file with partial control of the file content.

The "#cgo pkg-config:" directive in a Go source file provides command-line arguments to provide to the Go pkg-config command. An attacker can provide a "--log-file" argument to this directive, causing pkg-config to write to an attacker-controlled location.

Database specific
{
    "url": "https://pkg.go.dev/vuln/GO-2026-4339",
    "review_status": "REVIEWED"
}
References
Credits
    • RyotaK (https://ryotak.net) of GMO Flatt Security Inc.

Affected packages

Go / toolchain

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
1.24.12
Introduced
1.25.0
Fixed
1.25.6

Ecosystem specific

{
    "imports": [
        {
            "path": "cmd/go"
        }
    ]
}

Database specific

source
"https://vuln.go.dev/ID/GO-2026-4339.json"