Vulnerabilities > CVE-2017-14867 - OS Command Injection vulnerability in multiple products
Attack vector
NETWORK Attack complexity
LOW Privileges required
LOW Confidentiality impact
HIGH Integrity impact
HIGH Availability impact
HIGH Summary
Git before 2.10.5, 2.11.x before 2.11.4, 2.12.x before 2.12.5, 2.13.x before 2.13.6, and 2.14.x before 2.14.2 uses unsafe Perl scripts to support subcommands such as cvsserver, which allows attackers to execute arbitrary OS commands via shell metacharacters in a module name. The vulnerable code is reachable via git-shell even without CVS support.
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 SuSE Local Security Checks NASL id OPENSUSE-2017-1115.NASL description This update for git to version 2.13.6 fixes the following issues : - CVE-2017-14867: Various Perl scripts did not use safe_pipe_capture() instead of backticks, leaving them susceptible to end-user input (boo#1061041) As an additional measure, last seen 2020-06-05 modified 2017-10-03 plugin id 103622 published 2017-10-03 reporter This script is Copyright (C) 2017-2020 Tenable Network Security, Inc. source https://www.tenable.com/plugins/nessus/103622 title openSUSE Security Update : git (openSUSE-2017-1115) code #%NASL_MIN_LEVEL 80502 # # (C) Tenable Network Security, Inc. # # The descriptive text and package checks in this plugin were # extracted from openSUSE Security Update openSUSE-2017-1115. # # The text description of this plugin is (C) SUSE LLC. # include("compat.inc"); if (description) { script_id(103622); script_version("3.4"); script_set_attribute(attribute:"plugin_modification_date", value:"2020/06/04"); script_cve_id("CVE-2017-14867"); script_name(english:"openSUSE Security Update : git (openSUSE-2017-1115)"); script_summary(english:"Check for the openSUSE-2017-1115 patch"); script_set_attribute( attribute:"synopsis", value:"The remote openSUSE host is missing a security update." ); script_set_attribute( attribute:"description", value: "This update for git to version 2.13.6 fixes the following issues : - CVE-2017-14867: Various Perl scripts did not use safe_pipe_capture() instead of backticks, leaving them susceptible to end-user input (boo#1061041) As an additional measure, 'git cvsserver' no longer is invoked by 'git daemon' by default." ); script_set_attribute( attribute:"see_also", value:"https://bugzilla.opensuse.org/show_bug.cgi?id=1061041" ); script_set_attribute(attribute:"solution", value:"Update the affected git packages."); script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:S/C:C/I:C/A:C"); script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"); script_set_attribute(attribute:"plugin_type", value:"local"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:git"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:git-arch"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:git-core"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:git-core-debuginfo"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:git-credential-gnome-keyring"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:git-credential-gnome-keyring-debuginfo"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:git-cvs"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:git-daemon"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:git-daemon-debuginfo"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:git-debugsource"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:git-email"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:git-gui"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:git-svn"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:git-svn-debuginfo"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:git-web"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:gitk"); script_set_attribute(attribute:"cpe", value:"cpe:/o:novell:opensuse:42.3"); script_set_attribute(attribute:"patch_publication_date", value:"2017/10/02"); script_set_attribute(attribute:"plugin_publication_date", value:"2017/10/03"); script_end_attributes(); script_category(ACT_GATHER_INFO); script_copyright(english:"This script is Copyright (C) 2017-2020 Tenable Network Security, Inc."); script_family(english:"SuSE Local Security Checks"); script_dependencies("ssh_get_info.nasl"); script_require_keys("Host/local_checks_enabled", "Host/SuSE/release", "Host/SuSE/rpm-list", "Host/cpu"); exit(0); } include("audit.inc"); include("global_settings.inc"); include("rpm.inc"); if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED); release = get_kb_item("Host/SuSE/release"); if (isnull(release) || release =~ "^(SLED|SLES)") audit(AUDIT_OS_NOT, "openSUSE"); if (release !~ "^(SUSE42\.3)$") audit(AUDIT_OS_RELEASE_NOT, "openSUSE", "42.3", release); if (!get_kb_item("Host/SuSE/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING); ourarch = get_kb_item("Host/cpu"); if (!ourarch) audit(AUDIT_UNKNOWN_ARCH); if (ourarch !~ "^(i586|i686|x86_64)$") audit(AUDIT_ARCH_NOT, "i586 / i686 / x86_64", ourarch); flag = 0; if ( rpm_check(release:"SUSE42.3", reference:"git-2.13.6-7.1") ) flag++; if ( rpm_check(release:"SUSE42.3", reference:"git-arch-2.13.6-7.1") ) flag++; if ( rpm_check(release:"SUSE42.3", reference:"git-core-2.13.6-7.1") ) flag++; if ( rpm_check(release:"SUSE42.3", reference:"git-core-debuginfo-2.13.6-7.1") ) flag++; if ( rpm_check(release:"SUSE42.3", reference:"git-credential-gnome-keyring-2.13.6-7.1") ) flag++; if ( rpm_check(release:"SUSE42.3", reference:"git-credential-gnome-keyring-debuginfo-2.13.6-7.1") ) flag++; if ( rpm_check(release:"SUSE42.3", reference:"git-cvs-2.13.6-7.1") ) flag++; if ( rpm_check(release:"SUSE42.3", reference:"git-daemon-2.13.6-7.1") ) flag++; if ( rpm_check(release:"SUSE42.3", reference:"git-daemon-debuginfo-2.13.6-7.1") ) flag++; if ( rpm_check(release:"SUSE42.3", reference:"git-debugsource-2.13.6-7.1") ) flag++; if ( rpm_check(release:"SUSE42.3", reference:"git-email-2.13.6-7.1") ) flag++; if ( rpm_check(release:"SUSE42.3", reference:"git-gui-2.13.6-7.1") ) flag++; if ( rpm_check(release:"SUSE42.3", reference:"git-svn-2.13.6-7.1") ) flag++; if ( rpm_check(release:"SUSE42.3", reference:"git-svn-debuginfo-2.13.6-7.1") ) flag++; if ( rpm_check(release:"SUSE42.3", reference:"git-web-2.13.6-7.1") ) flag++; if ( rpm_check(release:"SUSE42.3", reference:"gitk-2.13.6-7.1") ) flag++; if (flag) { if (report_verbosity > 0) security_hole(port:0, extra:rpm_report_get()); else security_hole(0); exit(0); } else { tested = pkg_tests_get(); if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested); else audit(AUDIT_PACKAGE_NOT_INSTALLED, "git / git-arch / git-core / git-core-debuginfo / etc"); }
NASL family Huawei Local Security Checks NASL id EULEROS_SA-2019-2153.NASL description According to the versions of the git packages installed, the EulerOS installation on the remote host is affected by the following vulnerabilities : - GIT version 2.15.1 and earlier contains a Input Validation Error vulnerability in Client that can result in problems including messing up terminal configuration to RCE. This attack appear to be exploitable via The user must interact with a malicious git server, (or have their traffic modified in a MITM attack).(CVE-2018-1000021) - Git before 2.10.5, 2.11.x before 2.11.4, 2.12.x before 2.12.5, 2.13.x before 2.13.6, and 2.14.x before 2.14.2 uses unsafe Perl scripts to support subcommands such as cvsserver, which allows attackers to execute arbitrary OS commands via shell metacharacters in a module name. The vulnerable code is reachable via git-shell even without CVS support.(CVE-2017-14867) Note that Tenable Network Security has extracted the preceding description block directly from the EulerOS security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues. last seen 2020-05-08 modified 2019-11-12 plugin id 130862 published 2019-11-12 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/130862 title EulerOS 2.0 SP5 : git (EulerOS-SA-2019-2153) NASL family Huawei Local Security Checks NASL id EULEROS_SA-2019-1420.NASL description According to the versions of the git packages installed, the EulerOS Virtualization installation on the remote host is affected by the following vulnerabilities : - In Git before 2.13.7, 2.14.x before 2.14.4, 2.15.x before 2.15.2, 2.16.x before 2.16.4, and 2.17.x before 2.17.1, remote code execution can occur. With a crafted .gitmodules file, a malicious project can execute an arbitrary script on a machine that runs last seen 2020-06-01 modified 2020-06-02 plugin id 124923 published 2019-05-14 reporter This script is Copyright (C) 2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/124923 title EulerOS Virtualization 3.0.1.0 : git (EulerOS-SA-2019-1420) NASL family Debian Local Security Checks NASL id DEBIAN_DSA-3984.NASL description joernchen discovered that the git-cvsserver subcommand of Git, a distributed version control system, suffers from a shell command injection vulnerability due to unsafe use of the Perl backtick operator. The git-cvsserver subcommand is reachable from the git-shell subcommand even if CVS support has not been configured (however, the git-cvs package needs to be installed). In addition to fixing the actual bug, this update removes the cvsserver subcommand from git-shell by default. Refer to the updated documentation for instructions how to reenable in case this CVS functionality is still needed. last seen 2020-06-01 modified 2020-06-02 plugin id 103473 published 2017-09-27 reporter This script is Copyright (C) 2017-2018 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/103473 title Debian DSA-3984-1 : git - security update NASL family Debian Local Security Checks NASL id DEBIAN_DLA-1120.NASL description joernchen discovered that the git-cvsserver subcommand of Git, a distributed version control system, suffers from a shell command injection vulnerability due to unsafe use of the Perl backtick operator. The git-cvsserver subcommand is reachable from the git-shell subcommand even if CVS support has not been configured (however, the git-cvs package needs to be installed). For Debian 7 last seen 2020-03-17 modified 2017-10-03 plugin id 103607 published 2017-10-03 reporter This script is Copyright (C) 2017-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/103607 title Debian DLA-1120-1 : git security update NASL family PhotonOS Local Security Checks NASL id PHOTONOS_PHSA-2017-0038.NASL description An update of [gnutls, c-ares, nginx, mercurial, linux, mesos, git, binutils, krb5, dnsmasq] packages for PhotonOS has been released. last seen 2019-02-21 modified 2019-02-07 plugin id 111887 published 2018-08-17 reporter Tenable source https://www.tenable.com/plugins/index.php?view=single&id=111887 title Photon OS 1.0: Binutils / C / Dnsmasq / Git / Gnutls / Krb5 / Linux / Mercurial / Mesos / Nginx PHSA-2017-0038 (deprecated) NASL family Huawei Local Security Checks NASL id EULEROS_SA-2017-1265.NASL description According to the version of the git packages installed, the EulerOS installation on the remote host is affected by the following vulnerability : - Git before 2.10.5, 2.11.x before 2.11.4, 2.12.x before 2.12.5, 2.13.x before 2.13.6, and 2.14.x before 2.14.2 uses unsafe Perl scripts to support subcommands such as cvsserver, which allows attackers to execute arbitrary OS commands via shell metacharacters in a module name.(CVE-2017-14867) Note that Tenable Network Security has extracted the preceding description block directly from the EulerOS security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues. last seen 2020-05-06 modified 2017-11-01 plugin id 104290 published 2017-11-01 reporter This script is Copyright (C) 2017-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/104290 title EulerOS 2.0 SP1 : git (EulerOS-SA-2017-1265) NASL family SuSE Local Security Checks NASL id OPENSUSE-2017-1167.NASL description This update for git fixes the following issues : This security issue was fixed : - CVE-2017-14867: Git used unsafe Perl scripts to support subcommands such as cvsserver, which allowed attackers to execute arbitrary OS commands via shell metacharacters in a module name (bsc#1061041). This update was imported from the SUSE:SLE-12:Update update project. last seen 2020-06-05 modified 2017-10-23 plugin id 104077 published 2017-10-23 reporter This script is Copyright (C) 2017-2020 Tenable Network Security, Inc. source https://www.tenable.com/plugins/nessus/104077 title openSUSE Security Update : git (openSUSE-2017-1167) NASL family Huawei Local Security Checks NASL id EULEROS_SA-2017-1266.NASL description According to the version of the git packages installed, the EulerOS installation on the remote host is affected by the following vulnerability : - Git before 2.10.5, 2.11.x before 2.11.4, 2.12.x before 2.12.5, 2.13.x before 2.13.6, and 2.14.x before 2.14.2 uses unsafe Perl scripts to support subcommands such as cvsserver, which allows attackers to execute arbitrary OS commands via shell metacharacters in a module name.(CVE-2017-14867) Note that Tenable Network Security has extracted the preceding description block directly from the EulerOS security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues. last seen 2020-05-06 modified 2017-11-01 plugin id 104291 published 2017-11-01 reporter This script is Copyright (C) 2017-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/104291 title EulerOS 2.0 SP2 : git (EulerOS-SA-2017-1266) NASL family SuSE Local Security Checks NASL id SUSE_SU-2017-2747-1.NASL description This update for git fixes the following issues: This security issue was fixed : - CVE-2017-14867: Git used unsafe Perl scripts to support subcommands such as cvsserver, which allowed attackers to execute arbitrary OS commands via shell metacharacters in a module name (bsc#1061041). Note that Tenable Network Security has extracted the preceding description block directly from the SUSE security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues. last seen 2020-06-01 modified 2020-06-02 plugin id 103918 published 2017-10-18 reporter This script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/103918 title SUSE SLES12 Security Update : git (SUSE-SU-2017:2747-1) NASL family Ubuntu Local Security Checks NASL id UBUNTU_USN-3438-1.NASL description It was discovered that Git incorrectly handled certain subcommands such as cvsserver. A remote attacker could possibly use this issue via shell metacharacters in modules names to execute arbitrary code. This update also removes the cvsserver subcommand from git-shell by default. Note that Tenable Network Security has extracted the preceding description block directly from the Ubuntu security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues. last seen 2020-06-01 modified 2020-06-02 plugin id 103691 published 2017-10-06 reporter Ubuntu Security Notice (C) 2017-2019 Canonical, Inc. / NASL script (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/103691 title Ubuntu 14.04 LTS / 16.04 LTS / 17.04 : git vulnerability (USN-3438-1) NASL family SuSE Local Security Checks NASL id SUSE_SU-2020-0992-1.NASL description This update for git fixes the following issues : Security issue fixed : CVE-2020-5260: With a crafted URL that contains a newline in it, the credential helper machinery can be fooled to give credential information for a wrong host (bsc#1168930). Non-security issue fixed : git was updated to 2.26.0 for SHA256 support (bsc#1167890, jsc#SLE-11608): the xinetd snippet was removed the System V init script for the git-daemon was replaced by a systemd service file of the same name. git 2.26.0: last seen 2020-04-30 modified 2020-04-15 plugin id 135580 published 2020-04-15 reporter This script is Copyright (C) 2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/135580 title SUSE SLES12 Security Update : git (SUSE-SU-2020:0992-1)
References
- https://www.debian.org/security/2017/dsa-3984
- https://lists.debian.org/debian-security-announce/2017/msg00246.html
- https://bugs.debian.org/876854
- http://www.openwall.com/lists/oss-security/2017/09/26/9
- http://www.securitytracker.com/id/1039431
- http://www.securityfocus.com/bid/101060
- https://public-inbox.org/git/xmqqy3p29ekj.fsf%40gitster.mtv.corp.google.com/T/#u