Advisory

GO-2022-0476

Also known as: BIT-golang-2020-28367, CVE-2020-28367

Summary

Arbitrary code execution via the go command with cgo in cmd/go

Details

The go command may execute arbitrary code at build time when cgo is in use. This may occur when running go get on a malicious package, or any other command that builds untrusted code.

This can be caused by malicious gcc flags specified via a cgo directive.

Severity

Not rated by the source.

Dates

Published
2022-07-28 17:24 UTC
Modified
2024-05-20 16:03 UTC

Affected packages and fixes

toolchain

Go · All systems

Affected

  • introduced 0, fixed 1.14.12, introduced 1.15.0-0, fixed 1.15.5 (semver)

Fixed versions

1.14.12, 1.15.5

Fix

The export has no generic command for this ecosystem.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: Go Vulnerability Database · CC BY 4.0

Sources & licences