{"cve":"CVE-2018-16873","nvd":{"published":"2018-12-14T14:29:00.227","modified":"2026-06-17T01:44:57.767","status":"Modified","description":"In Go before 1.10.6 and 1.11.x before 1.11.3, the \"go get\" command is vulnerable to remote code execution when executed with the -u flag and the import path of a malicious Go package, or a package that imports it directly or indirectly. 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). Using custom domains, it's possible to arrange things so that a Git repository is cloned to a folder named \".git\" by using a vanity import path that ends with \"/.git\". If the Git repository root contains a \"HEAD\" file, a \"config\" file, an \"objects\" directory, a \"refs\" directory, with some work to ensure the proper ordering of operations, \"go get -u\" can be tricked into considering the parent directory as a repository root, and running Git commands on it. That will use the \"config\" file in the original Git repository root for its configuration, and if that config file contains malicious commands, they will execute on the system running \"go get -u\".","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.1},"cwes":["CWE-20"],"references":["http://lists.opensuse.org/opensuse-security-announce/2019-03/msg00044.html","http://lists.opensuse.org/opensuse-security-announce/2019-05/msg00060.html","http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00011.html","http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00015.html","http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00010.html"],"products":["debian:debian_linux","golang:go","opensuse:backports_sle","opensuse:leap","suse:linux_enterprise_server"],"source":"nvd","synced_at":"2026-10-19T20:54:36.112582389+00:00"},"epss":{"cve":"CVE-2018-16873","score":0.66252,"percentile":0.99277,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GO-2022-0189","url":"https://osv.dev/vulnerability/GO-2022-0189","summary":"Remote command execution via \"go get\" with \"-u\" flag in cmd/go","modified":"2024-05-20T16:03:47Z","packages":[{"ecosystem":"Go","name":"toolchain","purl":"pkg:golang/toolchain","ranges":["<1.10.6",">=1.11.0-0 <1.11.3"],"fixed":["1.10.6","1.11.3"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}