Advisory

GO-2022-0190

Also known as: CVE-2018-16874

Summary

Directory traversal via "go get" command in cmd/go

Details

The "go get" command is vulnerable to directory traversal when executed with the import path of a malicious Go package which contains curly brace (both '{' and '}' characters).

Specifically, it is only vulnerable in GOPATH mode, but not in module mode (the distinction is documented at https://golang.org/cmd/go/#hdr-Module_aware_go_get). The attacker can cause an arbitrary filesystem write, which can lead to code execution.

Severity

Not rated by the source.

Dates

Published
2022-08-02 15:44 UTC
Modified
2024-05-20 16:03 UTC

Affected packages and fixes

toolchain

Go · All systems

Affected

  • introduced 0, fixed 1.10.6, introduced 1.11.0-0, fixed 1.11.3 (semver)

Fixed versions

1.10.6, 1.11.3

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