Security mailing lists by PureSourceCode

CVE-2018-16873

HIGH 8.1CVSS 3.1

Remote command execution via "go get" with "-u" flag in cmd/go

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

Published
14 Dec 2018
Last modified
17 Jun 2026
Assigned by
secalert@redhat.com
NVD status
Modified
Weakness
CWE-20
Also known as
GO-2022-0189
Sources
NVDJSONOSV GO-2022-0189JSON

Scores

SourceScored byVersionScoreVector / decision
NVD nvd@nist.gov (Primary) CVSS 3.1 HIGH 8.1 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD secalert@redhat.com (Secondary) CVSS 3.0 HIGH 7.5 CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
NVD nvd@nist.gov (Primary) CVSS 2.0 MEDIUM 6.8 AV:N/AC:M/Au:N/C:P/I:P/A:P

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
NVD golang go
cpe:2.3:a:golang:go:*:*:*:*:*:*:*:*
< 1.10.6 1.10.6
NVD golang go
cpe:2.3:a:golang:go:*:*:*:*:*:*:*:*
>= 1.11.0, < 1.11.3 1.11.3
NVD opensuse backports_sle
cpe:2.3:a:opensuse:backports_sle:15.0:-:*:*:*:*:*:*
= 15.0
NVD opensuse leap
cpe:2.3:o:opensuse:leap:15.0:*:*:*:*:*:*:*
= 15.0
NVD opensuse leap
cpe:2.3:o:opensuse:leap:15.1:*:*:*:*:*:*:*
= 15.1
NVD opensuse leap
cpe:2.3:o:opensuse:leap:42.3:*:*:*:*:*:*:*
= 42.3
NVD suse linux_enterprise_server
cpe:2.3:o:suse:linux_enterprise_server:12:-:*:*:*:*:*:*
= 12
NVD debian debian_linux
cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*
= 9.0
OSV Go toolchain < 1.10.6; >= 1.11.0-0, < 1.11.3 1.10.6, 1.11.3

References

History

  • 25 Nov 2026 20:21 UTC · NVD: first stored (published 14 Dec 2018)
  • 25 Nov 2026 20:14 UTC · OSV: first stored (published 4 Aug 2022)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.