CVE-2018-16873
[UNKNOWN] golang: Improper Input Validation
Check your servers for CVE-2018-16873
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2018-16873 affects golang, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
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".
Severity (CVSS)
CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
- Attack vector
- network: an attacker can reach the vulnerable part over the network, often from the internet
- Attack complexity
- high: an attack depends on conditions outside the control of the attacker, such as a race
- Privileges required
- none: the attacker does not need an account
- User interaction
- required: a user has to do something, such as open a link or a file
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 66.1%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 99.4% of all scored CVEs. Scores of 29 Nov 2026.
Weakness
- CWE-20 Improper Input Validation
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
|
golang
[UNKNOWN]
|
affected 1.10.6 affected 1.11.3
|
Is my server affected?
Find the installed version of golang and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i golang
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2018-16873 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2018-16873RHEL, Rocky, Alma, Fedora
rpm -q golang
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2018-16873Alpine
apk list --installed | grep -i golangWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2018-16873
trivy image --scanners vuln IMAGE | grep CVE-2018-16873
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
- GLSA-201812-09 security.gentoo.org · vendor advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16873 bugzilla.redhat.com
- openSUSE-SU-2019:1079 lists.opensuse.org · vendor advisory
- openSUSE-SU-2019:1444 lists.opensuse.org · vendor advisory
- openSUSE-SU-2019:1499 lists.opensuse.org · vendor advisory
- openSUSE-SU-2019:1506 lists.opensuse.org · vendor advisory
- openSUSE-SU-2019:1703 lists.opensuse.org · vendor advisory
- openSUSE-SU-2020:0554 lists.opensuse.org · vendor advisory
Other references
- 106226 securityfocus.com · vdb entry
- https://groups.google.com/forum/?pli=1#%21topic/golang-announce/Kw31K8G7Fi0 groups.google.com
- [debian-lts-announce] 20210313 [SECURITY] [DLA 2591-1] golang-1.7 security update lists.debian.org · mailing list
- [debian-lts-announce] 20210313 [SECURITY] [DLA 2592-1] golang-1.8 security update lists.debian.org · mailing list
Source: the record CVE-2018-16873 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse