{"id":"CVE-2018-16873","published":"2018-12-14T14:00:00Z","modified":"2024-08-05T10:32:54Z","title":"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…","vendor":"[UNKNOWN]","product":"golang","tier":"core","eol":null,"affectedVersions":[{"vendor":"[UNKNOWN]","product":"golang","versions":["1.10.6","1.11.3"]}],"description":{"text":"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\".","provenance":"source","from":"CVE.org"},"summary":{"text":"The Go toolchain's \"go get\" command, in versions before 1.10.6 and 1.11.x before 1.11.3, mishandles vanity import paths ending in \"/.git\" in GOPATH mode, allowing a crafted repository layout to make it run Git commands against a parent directory and use a malicious \"config\" file. An attacker can achieve remote code execution by getting a victim to run \"go get -u\" on a malicious Go package, or on a package that imports it directly or indirectly, with the attack relying on a custom-domain vanity import path and careful ordering of repository files; module mode is not affected.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-13T14:57:52Z"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.0","vector":"CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.66123,"percentile":0.99292,"date":"2026-11-21","provenance":"source"},"kev":null,"vulncheckKev":null,"exploited":false,"otx":{"pulseCount":0,"pulses":[],"provenance":"machine"},"cwes":[{"id":"CWE-20","name":"Improper Input Validation"}],"references":[{"url":"http://www.securityfocus.com/bid/106226","tags":["vdb-entry","x_refsource_BID"]},{"url":"https://security.gentoo.org/glsa/201812-09","tags":["vendor-advisory","x_refsource_GENTOO"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16873","tags":["x_refsource_CONFIRM"]},{"url":"https://groups.google.com/forum/?pli=1#%21topic/golang-announce/Kw31K8G7Fi0","tags":["x_refsource_MISC"]},{"url":"http://lists.opensuse.org/opensuse-security-announce/2019-03/msg00044.html","tags":["vendor-advisory","x_refsource_SUSE"]},{"url":"http://lists.opensuse.org/opensuse-security-announce/2019-05/msg00060.html","tags":["vendor-advisory","x_refsource_SUSE"]},{"url":"http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00011.html","tags":["vendor-advisory","x_refsource_SUSE"]},{"url":"http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00015.html","tags":["vendor-advisory","x_refsource_SUSE"]},{"url":"http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00010.html","tags":["vendor-advisory","x_refsource_SUSE"]},{"url":"http://lists.opensuse.org/opensuse-security-announce/2020-04/msg00041.html","tags":["vendor-advisory","x_refsource_SUSE"]},{"url":"https://lists.debian.org/debian-lts-announce/2021/03/msg00014.html","tags":["mailing-list","x_refsource_MLIST"]},{"url":"https://lists.debian.org/debian-lts-announce/2021/03/msg00015.html","tags":["mailing-list","x_refsource_MLIST"]}],"techniques":[],"reports":[],"affected":[{"ecosystem":"Go","package":"toolchain","vulnerableRanges":["<1.10.6",">=1.11.0-0, <1.11.3"],"patched":["1.10.6","1.11.3"],"from":["GO-2022-0189"],"provenance":"source"}],"advisories":[{"id":"GO-2022-0189","url":"https://osv.dev/vulnerability/GO-2022-0189","severity":null,"ecosystem":"Go","package":"toolchain","vulnerableRanges":["<1.10.6",">=1.11.0-0, <1.11.3"],"patched":["1.10.6","1.11.3"],"provenance":"source","from":"OSV"}],"euvd":{"id":"EUVD-2018-8664","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2018-8664","exploited":false,"exploitedSince":null,"provenance":"source"},"exploits":[],"exploitSources":null,"exploitRefs":[],"flow":[],"timeline":[{"date":"2018-12-14","kind":"published","label":"Published (CVE.org)","url":"https://www.cve.org/CVERecord?id=CVE-2018-16873","provenance":"source"}],"speed":{"daysToPublicExploit":null,"firstExploitFrom":null,"daysToKev":null},"priority":{"score":25.1,"factors":[{"name":"In a KEV catalog","points":0.0,"detail":"not listed"},{"name":"Recent KEV listing","points":0.0,"detail":"not listed"},{"name":"Known ransomware use","points":0.0,"detail":"not known"},{"name":"EPSS percentile","points":19.86,"detail":"percentile 0.9929"},{"name":"Named in threat reports","points":0.0,"detail":"0 reports"},{"name":"Public exploit code","points":0.0,"detail":"none found"},{"name":"Mentioned in OTX pulses","points":0.0,"detail":"0 pulses"},{"name":"CVSS severity","points":5.25,"detail":"base score 7.5"},{"name":"End-of-life product","points":0.0,"detail":"supported or unknown"}]},"lineage":{"packageHistory":[{"cve":"CVE-2017-15041","published":"2017-10-05","fixed":"1.9.1","kev":false},{"cve":"CVE-2018-6574","published":"2018-02-07","fixed":"1.9.4","kev":false},{"cve":"CVE-2018-7187","published":"2018-02-16","fixed":"1.10.1","kev":false,"link":{"from":"CVE-2018-7187","to":"CVE-2018-16873","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Go:toolchain","fromFixed":"1.10.1","toFixed":"1.10.6","daysApart":301}]}},{"cve":"CVE-2018-16873","published":"2018-12-14","fixed":"1.11.3","kev":false},{"cve":"CVE-2018-16874","published":"2018-12-14","fixed":"1.11.3","kev":false},{"cve":"CVE-2020-28366","published":"2020-11-18","fixed":"1.15.5","kev":false},{"cve":"CVE-2020-28367","published":"2020-11-18","fixed":"1.15.5","kev":false}],"package":"Go:toolchain"}}