OS command execution in Go programming language - CVE-2018-7187
Published: April 17, 2018
Vulnerability identifier: #VU11851
CSH Severity: High
CVSS v4: 8.6 [CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N]
CVE-ID: CVE-2018-7187
CWE-ID: CWE-78
Exploitation vector: Remote access
Exploit availability:
No public exploit available
Vulnerability details
The vulnerability allows a remote attacker to execute arbitrary shell commands on the target system.
The weakness exists in the "go get" implementation due to insufficient validation of the import path (get/vcs.go only checks for "://" anywhere in the string) when the -insecure command-line option is used. A remote attacker can trick the victim into visiting a specially crafted website, inject OS commands and execute arbitrary code.
The weakness exists in the "go get" implementation due to insufficient validation of the import path (get/vcs.go only checks for "://" anywhere in the string) when the -insecure command-line option is used. A remote attacker can trick the victim into visiting a specially crafted website, inject OS commands and execute arbitrary code.
Affected software
Go programming language
Gentoo Linux
Fedora
SUSE Linux
Opensuse
golang-1.7 (Debian package)
golang-1.8 (Debian package)
openSUSE Leap
golang
Gentoo Linux
Fedora
SUSE Linux
Opensuse
golang-1.7 (Debian package)
golang-1.8 (Debian package)
openSUSE Leap
golang
How to mitigate CVE-2018-7187
Install update from vendor's website.
golang-1.7 (Debian package) - update to 1.7.4-2+deb9u1
golang-1.8 (Debian package) - update to 1.8.1-1+deb9u1
golang - addressed in versions 1.9.4-1.el6, 1.9.4-2.fc27, 1.10-2.fc28
golang-1.8 (Debian package) - update to 1.8.1-1+deb9u1
golang - addressed in versions 1.9.4-1.el6, 1.9.4-2.fc27, 1.10-2.fc28