CVE-2018-16873 in the critical feed json
Remote command execution via "go get" with "-u" flag in cmd/go
published 7y ago modified 4mo ago also GO-2022-0189 , EUVD-2018-8664
- cvss
- 7.5
- version 3.0, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 66.3%
- EPSS 66.3% chance of exploitation in 30 days, percentile 99.2%
- public exploits
- 0
- none known
Summary
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".
Patch / fix
- go toolchain 1.10.6, 1.11.3
- golang go 1.10.6, 1.11.3
- docker-stable SLES for SAP 15 SP5, SLES for SAP 15 SP4, SLES for SAP 15 SP3 +12 more 24.0.9_ce-150000.1.25.1
- etcd openSUSE Leap 15.6, openSUSE Leap 15.5 3.5.12-150000.7.6.1
- runc SLE Module for Containers 12 1.0.0~rc93-16.8.1
- docker SLE Module for Containers 12 20.10.6_ce-98.66.1
- containerd SLE Module for Containers 12 1.4.4-16.38.1
- helm-mirror SLE Module for Containers 15 SP1, SLE Module for Containers 15 0.2.1-1.7.1
- golang-github-docker-libnetwork SLE Module for Containers 15 SP1, SLE Module for Containers 15 0.7.0.1+gitr2726_872f0a83c98a-4.12.1
- docker SLE Module for Containers 15 SP1, SLE Module for Containers 15 18.09.6_ce-6.17.1
suse advisories SUSE-SU-2025:03545-1SUSE-SU-2025:03540-1SUSE-SU-2024:3656-1SUSE-SU-2021:1458-1SUSE-SU-2019:0048-2SUSE-SU-2019:1234-2
- helm3 openSUSE Tumbleweed 3.19.2-1.1
- docker-stable openSUSE Tumbleweed 24.0.9_ce-15.1
- containerd openSUSE Tumbleweed 1.4.8-2.2
- cri-o openSUSE Tumbleweed 1.22.0-1.2
- docker openSUSE Tumbleweed 20.10.6_ce-2.1
- etcd openSUSE Tumbleweed 3.4.16-3.1
- flannel openSUSE Tumbleweed 0.14.0-1.2
- go openSUSE Tumbleweed 1.17-1.1
opensuse advisories openSUSE-SU-2025:15779-1openSUSE-SU-2025:15589-1openSUSE-SU-2024:10693-1openSUSE-SU-2024:10699-1openSUSE-SU-2024:10722-1openSUSE-SU-2024:10741-1
- go Arch Linux 2:1.11.3-1
arch linux advisories AVG-835
Is CVE-2018-16873 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerVendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2018-16873 updated cvss 7.5
golang: "go get" command vulnerable to RCE via import of malicious package
-
Red Hat Ceph Storage 2 golang, golang-bin, golang-src Red Hat Ceph Storage 3 golang, golang-bin, golang-src Red Hat Enterprise Linux 7 golang, golang-bin, golang-src, golang-misc, golang-testsaffected: no fix planned “Will not fix”
-
Red Hat OpenShift Container Platform 3.7 atomic-openshift, atomic-openshift-pod, atomic-openshift-node, atomic-openshift-tests, atomic-openshift-master, atomic-openshift-clients, +10 moreaffected: no fix planned “Out of support scope”
-
Red Hat OpenShift Container Platform 3.9 atomic-openshift, atomic-openshift-pod, atomic-openshift-node, atomic-openshift-tests, atomic-openshift-master, atomic-openshift-clients, +8 more Red Hat OpenShift Container Platform 3.10 atomic-openshift, atomic-openshift-pod, atomic-openshift-node, atomic-openshift-tests, atomic-openshift-master, atomic-openshift-clients, +7 moreaffected: no fix available “Fix deferred”
-
Red Hat OpenStack Platform 8 (Liberty) Operational Tools golang, golang-src, golang-pkg-linux-amd64, golang-pkg-bin-linux-amd64 Red Hat OpenStack Platform 9 (Mitaka) Operational Tools golang, golang-bin, golang-src Red Hat Storage 3 golang, golang-bin, golang-src, golang-misc, golang-testsaffected: no fix planned “Will not fix”
-
Red Hat Enterprise Linux 8 golang, go-toolset, golang-bin, golang-src, golang-misc, golang-race, +1 more Red Hat OpenShift Container Platform 3.11 atomic-openshift, atomic-openshift-pod, atomic-openshift-node, atomic-openshift-tests, atomic-openshift-master, atomic-openshift-clients, +7 more Red Hat OpenShift Container Platform 4 openshift, openshift-clients, openshift-kubelet, openshift-hyperkube, openshift-kube-apiserver, openshift-kube-scheduler, +2 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
66.25% chance of exploitation in the next 30 days, higher than 99.2% of all scored CVEs (FIRST EPSS, 2026-11-09).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.0 | 7.5 | CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 8.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 2.0 | 6.8 | AV:N/AC:M/Au:N/C:P/I:P/A:P |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| go | toolchain | <1.10.6 >=1.11.0-0, <1.11.3 |
1.10.6 1.11.3 |
Affected products
- [UNKNOWN] golang
Classification
- Weakness
-
- CWE-20 Improper Input Validation
References
-
go.dev
/cl/154101
patch
-
go.googlesource.com
/go/+/bc82d7c7db83487e05d7a88e06549d4ae2a688c3
patch
-
security.gentoo.org
/glsa/201812-09
vendor-advisory, mitigation, third-party-advisory
-
lists.opensuse.org
/opensuse-security-announce/2019-03/msg00044.html
vendor-advisory, mailing-list, third-party-advisory
-
lists.opensuse.org
/opensuse-security-announce/2019-05/msg00060.html
vendor-advisory, mailing-list, third-party-advisory
-
lists.opensuse.org
/opensuse-security-announce/2019-06/msg00011.html
vendor-advisory, mailing-list, third-party-advisory
-
lists.opensuse.org
/opensuse-security-announce/2019-06/msg00015.html
vendor-advisory, mailing-list, third-party-advisory
-
lists.opensuse.org
/opensuse-security-announce/2019-07/msg00010.html
vendor-advisory, mailing-list, third-party-advisory
-
lists.opensuse.org
/opensuse-security-announce/2020-04/msg00041.html
vendor-advisory, mailing-list, third-party-advisory
-
securityfocus.com
/bid/106226
vdb-entry, third-party-advisory
-
bugzilla.redhat.com
/show_bug.cgi?id=CVE-2018-16873
issue-tracking, third-party-advisory
- groups.google.com /forum/?pli=1#%21topic/golang-announce/Kw31K8G7Fi0
-
lists.debian.org
/debian-lts-announce/2021/03/msg00014.html
mailing-list, third-party-advisory
-
lists.debian.org
/debian-lts-announce/2021/03/msg00015.html
mailing-list, third-party-advisory
-
go.dev
/issue/29230
report
-
groups.google.com
/g/golang-announce/c/Kw31K8G7Fi0
web
Sources
- CVE List CVE-2018-16873
- NVD CVE-2018-16873
- OSV GO-2022-0189
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.