Vulnerabilities > CVE-2018-7187 - OS Command Injection vulnerability in multiple products
Attack vector
NETWORK Attack complexity
LOW Privileges required
NONE Confidentiality impact
HIGH Integrity impact
HIGH Availability impact
HIGH Summary
The "go get" implementation in Go 1.9.4, when the -insecure command-line option is used, does not validate the import path (get/vcs.go only checks for "://" anywhere in the string), which allows remote attackers to execute arbitrary OS commands via a crafted web site.
Vulnerable Configurations
Common Weakness Enumeration (CWE)
Common Attack Pattern Enumeration and Classification (CAPEC)
- Command Line Execution through SQL Injection An attacker uses standard SQL injection methods to inject data into the command line for execution. This could be done directly through misuse of directives such as MSSQL_xp_cmdshell or indirectly through injection of data into the database that would be interpreted as shell commands. Sometime later, an unscrupulous backend application (or could be part of the functionality of the same application) fetches the injected data stored in the database and uses this data as command line arguments without performing proper validation. The malicious data escapes that data plane by spawning new commands to be executed on the host.
- Command Delimiters An attack of this type exploits a programs' vulnerabilities that allows an attacker's commands to be concatenated onto a legitimate command with the intent of targeting other resources such as the file system or database. The system that uses a filter or a blacklist input validation, as opposed to whitelist validation is vulnerable to an attacker who predicts delimiters (or combinations of delimiters) not present in the filter or blacklist. As with other injection attacks, the attacker uses the command delimiter payload as an entry point to tunnel through the application and activate additional attacks through SQL queries, shell commands, network scanning, and so on.
- Exploiting Multiple Input Interpretation Layers An attacker supplies the target software with input data that contains sequences of special characters designed to bypass input validation logic. This exploit relies on the target making multiples passes over the input data and processing a "layer" of special characters with each pass. In this manner, the attacker can disguise input that would otherwise be rejected as invalid by concealing it with layers of special/escape characters that are stripped off by subsequent processing steps. The goal is to first discover cases where the input validation layer executes before one or more parsing layers. That is, user input may go through the following logic in an application: In such cases, the attacker will need to provide input that will pass through the input validator, but after passing through parser2, will be converted into something that the input validator was supposed to stop.
- Argument Injection An attacker changes the behavior or state of a targeted application through injecting data or command syntax through the targets use of non-validated and non-filtered arguments of exposed services or methods.
- OS Command Injection In this type of an attack, an adversary injects operating system commands into existing application functions. An application that uses untrusted input to build command strings is vulnerable. An adversary can leverage OS command injection in an application to elevate privileges, execute arbitrary commands and compromise the underlying operating system.
Nessus
NASL family PhotonOS Local Security Checks NASL id PHOTONOS_PHSA-2018-1_0-0123.NASL description An update of 'go' packages of Photon OS has been released. last seen 2019-02-08 modified 2019-02-07 plugin id 111927 published 2018-08-17 reporter Tenable source https://www.tenable.com/plugins/index.php?view=single&id=111927 title Photon OS 1.0: Go PHSA-2018-1.0-0123 (deprecated) NASL family Debian Local Security Checks NASL id DEBIAN_DLA-1294.NASL description It was discovered that there was an arbitrary command execution vulnerability in the Go programming language. The last seen 2020-03-17 modified 2018-02-26 plugin id 106985 published 2018-02-26 reporter This script is Copyright (C) 2018-2020 Tenable Network Security, Inc. source https://www.tenable.com/plugins/nessus/106985 title Debian DLA-1294-1 : golang security update NASL family Amazon Linux Local Security Checks NASL id ALA_ALAS-2018-975.NASL description Arbitrary code execution during last seen 2020-06-01 modified 2020-06-02 plugin id 108600 published 2018-03-27 reporter This script is Copyright (C) 2018-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/108600 title Amazon Linux AMI : golang (ALAS-2018-975) NASL family Fedora Local Security Checks NASL id FEDORA_2018-FE65C14082.NASL description Security fix for CVE-2018-7187 Note that Tenable Network Security has extracted the preceding description block directly from the Fedora update system website. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues. last seen 2020-06-05 modified 2019-01-03 plugin id 120938 published 2019-01-03 reporter This script is Copyright (C) 2019-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/120938 title Fedora 28 : golang (2018-fe65c14082) NASL family SuSE Local Security Checks NASL id SUSE_SU-2018-4297-1.NASL description This update for containerd, docker and go fixes the following issues : containerd and docker : Add backport for building containerd (bsc#1102522, bsc#1113313) Upgrade to containerd v1.1.2, which is required for Docker v18.06.1-ce. (bsc#1102522) Enable seccomp support on SLE12 (fate#325877) Update to containerd v1.1.1, which is the required version for the Docker v18.06.0-ce upgrade. (bsc#1102522) Put containerd under the podruntime slice (bsc#1086185) 3rd party registries used the default Docker certificate (bsc#1084533) Handle build breakage due to missing last seen 2020-03-18 modified 2019-01-02 plugin id 120195 published 2019-01-02 reporter This script is Copyright (C) 2019-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/120195 title SUSE SLED15 / SLES15 Security Update : containerd, docker / go (SUSE-SU-2018:4297-1) NASL family Debian Local Security Checks NASL id DEBIAN_DSA-4380.NASL description A vulnerability was discovered in the implementation of the P-521 and P-384 elliptic curves, which could result in denial of service and in some cases key recovery. In addition this update fixes two vulnerabilities in last seen 2020-03-17 modified 2019-02-04 plugin id 121558 published 2019-02-04 reporter This script is Copyright (C) 2019-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/121558 title Debian DSA-4380-1 : golang-1.8 - security update NASL family Gentoo Local Security Checks NASL id GENTOO_GLSA-201804-12.NASL description The remote host is affected by the vulnerability described in GLSA-201804-12 (Go: Arbitrary code execution) A vulnerability in Go was discovered which does not validate the import path of remote repositories. Impact : Remote attackers, by enticing a user to import from a crafted website, could execute arbitrary commands. Workaround : There is no known workaround at this time. last seen 2020-06-01 modified 2020-06-02 plugin id 109056 published 2018-04-16 reporter This script is Copyright (C) 2018 Tenable Network Security, Inc. source https://www.tenable.com/plugins/nessus/109056 title GLSA-201804-12 : Go: Arbitrary code execution NASL family PhotonOS Local Security Checks NASL id PHOTONOS_PHSA-2018-1_0-0123_GO.NASL description An update of the go package has been released. last seen 2020-03-17 modified 2019-02-07 plugin id 121818 published 2019-02-07 reporter This script is Copyright (C) 2019-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/121818 title Photon OS 1.0: Go PHSA-2018-1.0-0123 NASL family PhotonOS Local Security Checks NASL id PHOTONOS_PHSA-2018-2_0-0034.NASL description An update of {'go'} packages of Photon OS has been released. last seen 2019-02-08 modified 2019-02-07 plugin id 111295 published 2018-07-24 reporter Tenable source https://www.tenable.com/plugins/index.php?view=single&id=111295 title Photon OS 2.0 : go (PhotonOS-PHSA-2018-2.0-0034) (deprecated) NASL family SuSE Local Security Checks NASL id OPENSUSE-2019-482.NASL description This update for go1.9 fixes the following issues : Security issues fixed : - CVE-2018-7187: arbitrary command execution via VCS path (boo#1081495) Non-security changes : - Update to version 1.9.7 - fixes to the go command and compiler - minimal support to the go command for the vgo transition last seen 2020-05-31 modified 2019-03-27 plugin id 123200 published 2019-03-27 reporter This script is Copyright (C) 2019-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/123200 title openSUSE Security Update : go1.9 (openSUSE-2019-482) NASL family Debian Local Security Checks NASL id DEBIAN_DSA-4379.NASL description A vulnerability was discovered in the implementation of the P-521 and P-384 elliptic curves, which could result in denial of service and in some cases key recovery. In addition this update fixes a vulnerability in last seen 2020-03-17 modified 2019-02-04 plugin id 121557 published 2019-02-04 reporter This script is Copyright (C) 2019-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/121557 title Debian DSA-4379-1 : golang-1.7 - security update NASL family SuSE Local Security Checks NASL id OPENSUSE-2018-1626.NASL description This update for containerd, docker and go fixes the following issues : containerd and docker : - Add backport for building containerd (bsc#1102522, bsc#1113313) - Upgrade to containerd v1.1.2, which is required for Docker v18.06.1-ce. (bsc#1102522) - Enable seccomp support (fate#325877) - Update to containerd v1.1.1, which is the required version for the Docker v18.06.0-ce upgrade. (bsc#1102522) - Put containerd under the podruntime slice (bsc#1086185) - 3rd party registries used the default Docker certificate (bsc#1084533) - Handle build breakage due to missing last seen 2020-06-05 modified 2018-12-31 plugin id 119952 published 2018-12-31 reporter This script is Copyright (C) 2018-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/119952 title openSUSE Security Update : containerd / docker and go (openSUSE-2018-1626) NASL family SuSE Local Security Checks NASL id OPENSUSE-2018-672.NASL description This update for go1.9 fixes the following issues : Security issues fixed : - CVE-2018-7187: arbitrary command execution via VCS path (boo#1081495) Non-security changes : - Update to version 1.9.7 - fixes to the go command and compiler - minimal support to the go command for the vgo transition last seen 2020-06-05 modified 2018-06-25 plugin id 110681 published 2018-06-25 reporter This script is Copyright (C) 2018-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/110681 title openSUSE Security Update : go1.9 (openSUSE-2018-672) NASL family PhotonOS Local Security Checks NASL id PHOTONOS_PHSA-2018-2_0-0034_GO.NASL description An update of the go package has been released. last seen 2020-03-17 modified 2019-02-07 plugin id 121932 published 2019-02-07 reporter This script is Copyright (C) 2019-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/121932 title Photon OS 2.0: Go PHSA-2018-2.0-0034 NASL family SuSE Local Security Checks NASL id OPENSUSE-2019-1044.NASL description This update for containerd, docker and go fixes the following issues : containerd and docker : - Add backport for building containerd (bsc#1102522, bsc#1113313) - Upgrade to containerd v1.1.2, which is required for Docker v18.06.1-ce. (bsc#1102522) - Enable seccomp support (fate#325877) - Update to containerd v1.1.1, which is the required version for the Docker v18.06.0-ce upgrade. (bsc#1102522) - Put containerd under the podruntime slice (bsc#1086185) - 3rd party registries used the default Docker certificate (bsc#1084533) - Handle build breakage due to missing last seen 2020-06-01 modified 2020-06-02 plugin id 123165 published 2019-03-27 reporter This script is Copyright (C) 2019-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/123165 title openSUSE Security Update : containerd / docker and go (openSUSE-2019-1044)
References
- https://github.com/golang/go/issues/23867
- https://lists.debian.org/debian-lts-announce/2018/02/msg00029.html
- https://gist.github.com/SLAYEROWNER/b2a358f13ab267f2e9543bb9f9320ffc
- https://security.gentoo.org/glsa/201804-12
- https://www.debian.org/security/2019/dsa-4380
- https://www.debian.org/security/2019/dsa-4379