GO-2022-0190

See a problem?
Source
https://pkg.go.dev/vuln/GO-2022-0190
Import Source
https://vuln.go.dev/ID/GO-2022-0190.json
JSON Data
https://api.osv.dev/v1/vulns/GO-2022-0190
Aliases
Published
2022-08-02T15:44:23Z
Modified
2024-05-20T16:03:47Z
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-Moduleawarego_get). The attacker can cause an arbitrary filesystem write, which can lead to code execution.

References
Credits
    • ztz of Tencent Security Platform

Affected packages

Go / toolchain

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
1.10.6
Introduced
1.11.0-0
Fixed
1.11.3

Ecosystem specific

{
    "imports": [
        {
            "path": "cmd/go/internal/get",
            "symbols": [
                "downloadPackage"
            ]
        }
    ]
}