Vulnerability
CVE-2018-16873
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".
38 advisories report this vulnerability, across 6 ecosystems.
Advisories
-
DLA-2591-1
golang-1.7 - security update
-
DLA-2592-1
golang-1.8 - security update
-
GO-2022-0189
Remote command execution via "go get" with "-u" flag in cmd/go
-
RHVEX-CVE-2018-16873
golang: "go get" command vulnerable to RCE via import of malicious package
-
SUSE-SU-2018:4297-1
Security update for containerd, docker and go
-
SUSE-SU-2019:0048-1
Security update for helm-mirror
-
SUSE-SU-2019:0048-2
Security update for helm-mirror
-
SUSE-SU-2019:0286-1
Security update for docker
-
SUSE-SU-2019:0495-1
Security update for containerd, docker, docker-runc, golang-github-docker-libnetwork, runc
-
SUSE-SU-2019:0573-1
Security update for containerd, docker, docker-runc, golang-github-docker-libnetwork, runc
-
SUSE-SU-2019:1234-1
Security update for containerd, docker, docker-runc, go, go1.11, go1.12, golang-github-docker-libnetwork
-
SUSE-SU-2019:1234-2
Security update for containerd, docker, docker-runc, go, go1.11, go1.12, golang-github-docker-libnetwork
-
SUSE-SU-2019:1264-1
Security update for containerd, docker, docker-runc, go, go1.11, go1.12, golang-github-docker-libnetwork
-
SUSE-SU-2021:1458-1
Security update for containerd, docker, runc
-
SUSE-SU-2024:3656-1
Security update for etcd
-
SUSE-SU-2025:03540-1
Security update for docker-stable
-
SUSE-SU-2025:03545-1
Security update for docker-stable
-
UBUNTU-CVE-2018-16873
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…
-
openSUSE-SU-2019:0170-1
Security update for runc
-
openSUSE-SU-2019:1444-1
Security update for containerd, docker, docker-runc, go, go1.11, go1.12, golang-github-docker-libnetwork
-
openSUSE-SU-2019:1499-1
Security update for containerd, docker, docker-runc, go, go1.11, go1.12, golang-github-docker-libnetwork
-
openSUSE-SU-2019:1506-1
Security update for containerd, docker, docker-runc, go, go1.11, go1.12, golang-github-docker-libnetwork
-
openSUSE-SU-2019:1703-1
Security update for helm
-
openSUSE-SU-2020:0554-1
Security update for kubernetes
-
openSUSE-SU-2024:10693-1
containerd-1.4.8-2.2 on GA media
-
openSUSE-SU-2024:10699-1
cri-o-1.22.0-1.2 on GA media
-
openSUSE-SU-2024:10722-1
docker-20.10.6_ce-2.1 on GA media
-
openSUSE-SU-2024:10741-1
etcd-3.4.16-3.1 on GA media
-
openSUSE-SU-2024:10761-1
flannel-0.14.0-1.2 on GA media
-
openSUSE-SU-2024:10802-1
go-1.17-1.1 on GA media
-
openSUSE-SU-2024:10803-1
go1.10-1.10.8-8.2 on GA media
-
openSUSE-SU-2024:10804-1
go1.11-1.11.13-10.5 on GA media
-
openSUSE-SU-2024:10805-1
go1.12-1.12.17-4.8 on GA media
-
openSUSE-SU-2024:10841-1
helm-3.6.3-1.1 on GA media
-
openSUSE-SU-2024:10842-1
helm-mirror-0.3.1-1.9 on GA media
-
openSUSE-SU-2024:11358-1
runc-1.0.2-1.2 on GA media
-
openSUSE-SU-2025:15589-1
docker-stable-24.0.9_ce-15.1 on GA media
-
openSUSE-SU-2025:15779-1
helm3-3.19.2-1.1 on GA media
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
- http://lists.opensuse.org/opensuse-security-announce/2020-04/msg00041.html
- http://www.securityfocus.com/bid/106226
- https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16873
- https://groups.google.com/forum/?pli=1#%21topic/golang-announce/Kw31K8G7Fi0
- https://lists.debian.org/debian-lts-announce/2021/03/msg00014.html
- https://lists.debian.org/debian-lts-announce/2021/03/msg00015.html
- https://security.gentoo.org/glsa/201812-09