← Vulnerability feed

Vulnerability record · CVE-2018-16873 · published 14 December 2018

CVE-2018-16873: Go go get -u remote code execution via malicious import path

Golang · Go

In Go before 1.10.6 and 1.11.x before 1.11.3, the "go get" command with the -u flag can be tricked into running attacker-controlled Git commands when fetching a malicious package or a package that imports it. A vanity import path ending in "/.git" causes a Git repository to be cloned into a folder named ".git", and a crafted config file in that repository root is then used as Git configuration, executing arbitrary commands. This matters because a routine dependency update can silently run attacker code on the developer or build machine.

8.1 CVSS 3.1 High EPSS 66% · top 0.7% CWE-20 · Improper input validation
8.1CVSS 3.1 base score, v2 6.8
66%EPSS exploitation probability, 30 days
NoNot in CISA KEV
5Affected product versions listed by NVD
24References
17 Jun 2026Last modified by NVD

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:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Automated analysis

Generated by VULONE's analysis model from the NVD record, CISA KEV and EPSS data on 19 September 2026. Confidence: high.

high priorityCVSS 8.1 with high confidentiality, integrity and availability impact and a very high EPSS percentile, though exploitation requires the victim to run "go get -u" in GOPATH mode.

What it is

In Go before 1.10.6 and 1.11.x before 1.11.3, the "go get" command with the -u flag can be tricked into running attacker-controlled Git commands when fetching a malicious package or a package that imports it. A vanity import path ending in "/.git" causes a Git repository to be cloned into a folder named ".git", and a crafted config file in that repository root is then used as Git configuration, executing arbitrary commands. This matters because a routine dependency update can silently run attacker code on the developer or build machine.

Impact

An attacker gains arbitrary code execution with the privileges of the user running "go get -u", which on build or CI hosts can mean full compromise of the workspace and any credentials or artifacts it can reach.

Attack surface

Reached over the network when a developer or build system runs "go get -u" against a malicious import path or a package that transitively imports one; no authentication is required, but exploitation depends on the victim performing that fetch, and it only applies in GOPATH mode, not module mode.

Exploitation

Not listed in CISA KEV and no ransomware associations are recorded, but EPSS is high (0.66252, 99.2nd percentile), indicating substantial predicted exploitation activity; references are advisories, mailing lists and a Gentoo mitigation note, with no public exploit tag.

What to do

  • Upgrade Go to 1.10.6, 1.11.3 or later, and rebuild any tooling or images that bundle an older toolchain.
  • Apply the vendor updates referenced by the SUSE, openSUSE and Debian advisories for packaged Go.
  • Avoid running "go get -u" in GOPATH mode against untrusted or unvetted import paths; prefer module mode where the flaw does not apply.
  • Restrict outbound access from build and CI hosts so they cannot fetch arbitrary external Git repositories.
  • Run dependency fetches in a sandboxed, low-privilege environment without access to production credentials.

Detection

  • Monitor build and CI hosts for "go get -u" invocations and for Git processes spawned by Go tooling.
  • Alert on Git repositories or clones containing a ".git" directory whose parent also holds HEAD, config, objects and refs entries.
  • Inspect Git config files in fetched repositories for hooks or aliases that execute shell commands.
  • Watch for unexpected outbound Git or HTTP fetches from developer and build machines to unfamiliar vanity import domains.

This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.

Affected products

5 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

LinkTags
http://lists.opensuse.org/opensuse-security-announce/2019-03/msg00044.html Mailing ListThird Party Advisory
http://lists.opensuse.org/opensuse-security-announce/2019-05/msg00060.html Mailing ListThird Party Advisory
http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00011.html Mailing ListThird Party Advisory
http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00015.html Mailing ListThird Party Advisory
http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00010.html Mailing ListThird Party Advisory
http://lists.opensuse.org/opensuse-security-announce/2020-04/msg00041.html Mailing ListThird Party Advisory
http://www.securityfocus.com/bid/106226 Third Party AdvisoryVDB Entry
https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16873 Issue TrackingThird Party Advisory
https://groups.google.com/forum/?pli=1#%21topic/golang-announce/Kw31K8G7Fi0
https://lists.debian.org/debian-lts-announce/2021/03/msg00014.html Mailing ListThird Party Advisory
https://lists.debian.org/debian-lts-announce/2021/03/msg00015.html Mailing ListThird Party Advisory
https://security.gentoo.org/glsa/201812-09 MitigationThird Party Advisory
http://lists.opensuse.org/opensuse-security-announce/2019-03/msg00044.html Mailing ListThird Party Advisory
http://lists.opensuse.org/opensuse-security-announce/2019-05/msg00060.html Mailing ListThird Party Advisory
http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00011.html Mailing ListThird Party Advisory
http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00015.html Mailing ListThird Party Advisory
http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00010.html Mailing ListThird Party Advisory
http://lists.opensuse.org/opensuse-security-announce/2020-04/msg00041.html Mailing ListThird Party Advisory
http://www.securityfocus.com/bid/106226 Third Party AdvisoryVDB Entry
https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16873 Issue TrackingThird Party Advisory
https://groups.google.com/forum/?pli=1#%21topic/golang-announce/Kw31K8G7Fi0
https://lists.debian.org/debian-lts-announce/2021/03/msg00014.html Mailing ListThird Party Advisory
https://lists.debian.org/debian-lts-announce/2021/03/msg00015.html Mailing ListThird Party Advisory
https://security.gentoo.org/glsa/201812-09 MitigationThird Party Advisory

Track CVE-2018-16873 inside VULONE

Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

10.0CVE-2025-32433Erlang/OTP SSH server missing authentication allows remote code executionErlang/OTP SSH servers before OTP-27.3.3, OTP-26.2.5.11 and OTP-25.3.2.20 mishandle SSH protocol messages, letting an unauthenticated attacker execut…KEVEPSS 99%analysed10.0CVE-2025-24201Apple WebKit out-of-bounds write allows sandbox escapeCVE-2025-24201 is an out-of-bounds write in Apple's WebKit that was addressed with improved checks. Maliciously crafted web content may break out of …KEVEPSS 3.8%analysed10.0CVE-2021-44228Apache Log4j2 JNDI lookup remote code executionApache Log4j2 versions 2.0-beta9 through 2.15.0 (excluding 2.12.2, 2.12.3, and 2.3.1) do not protect against attacker-controlled LDAP and other JNDI …KEVEPSS 100%analysed9.8CVE-2026-24061GNU Inetutils telnetd argument injection allows remote auth bypasstelnetd in GNU Inetutils through 2.7 fails to sanitize the USER environment variable, so a value such as "-f root" is passed as an argument to login …KEVEPSS 99%analysed9.8CVE-2025-39682Linux kernel TLS zero-length record handling flaw on rx_listThe Linux kernel TLS receive path mishandles zero-length records that arrive from the rx_list, breaking the assumption that a record type change cann…KEVEPSS 2.9%analysed9.8CVE-2025-24813Apache Tomcat Default Servlet path equivalence enables RCE and file disclosureApache Tomcat mishandles path equivalence for names containing an internal dot, letting a remote unauthenticated attacker write files through the Def…KEVEPSS 100%analysed9.8CVE-2024-9680Mozilla Firefox and Thunderbird use-after-free in Animation timelinesA use-after-free flaw in Animation timelines allows an attacker to execute code in the content process of Firefox and Thunderbird. Mozilla reports ex…KEVEPSS 23%analysed9.8CVE-2023-46604Apache ActiveMQ OpenWire deserialization remote code executionThe Java OpenWire protocol marshaller in Apache ActiveMQ deserializes untrusted data, letting an attacker manipulate serialized class types so the br…KEVEPSS 100%analysed

Source: NIST National Vulnerability Database (record CVE-2018-16873), CISA KEV, FIRST EPSS (scores of 2026-09-26). This page is refreshed as NVD updates the record.