CVEfocus › CVE database › CVE-2018-16873

CVE-2018-16873

CVSS 7.5 HighEPSS 66.1% (in the top 1% of all CVEs)Published 2018-12-14Updated 2024-08-05Assigner: redhat

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".

CWE-20

What to do

Likely to be exploited: EPSS gives a 66% chance of exploitation in the next 30 days. Treat it as urgent if you run an affected version.

Fixed builds are available from Go: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

1Fixed
8Fix pending
6Will not fix
8Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 18.04golang-1.10Fix pendingUBUNTU-CVE-2018-16873
Ubuntu 18.04golang-1.8Fix pendingUBUNTU-CVE-2018-16873
Ubuntu 18.04golang-1.9Fix pendingUBUNTU-CVE-2018-16873
Ubuntu 16.04golang-1.10Fix pendingUBUNTU-CVE-2018-16873
Ubuntu 16.04golang-1.6Fix pendingUBUNTU-CVE-2018-16873
Ubuntu 14.04golangFix pending
Ubuntu 14.04golang-1.10Fix pendingUBUNTU-CVE-2018-16873
Ubuntu 14.04golang-1.6Fix pending
Red Hat Enterprise Linux 8go-toolsetNot affected
Red Hat Enterprise Linux 8golangNot affected
Red Hat Enterprise Linux 8golang-binNot affected
Red Hat Enterprise Linux 8golang-docsNot affected
Red Hat Enterprise Linux 8golang-miscNot affected
Red Hat Enterprise Linux 8golang-raceNot affected
Red Hat Enterprise Linux 8golang-srcNot affected
Red Hat Enterprise Linux 8golang-testsNot affected
Red Hat Enterprise Linux 7golangWill not fix
Will not fix
Red Hat Enterprise Linux 7golang-binWill not fix
Will not fix
Red Hat Enterprise Linux 7golang-docsWill not fix
Will not fix
Red Hat Enterprise Linux 7golang-miscWill not fix
Will not fix
Red Hat Enterprise Linux 7golang-srcWill not fix
Will not fix
Red Hat Enterprise Linux 7golang-testsWill not fix
Will not fix
Go librarytoolchainFixed1.11.3GO-2022-0189

What the vendor says

As published in the CVE record by redhat, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.