9.3 CVE-2020-5260

Privilege Escalation RCE Injection SQL Buffer Overflow RCI XSS Local Execution Code Patch
 

Affected versions of Git have a vulnerability whereby Git can be tricked into sending private credentials to a host controlled by an attacker. Git uses external "credential helper" programs to store and retrieve passwords or other credentials from secure storage provided by the operating system. Specially-crafted URLs that contain an encoded newline can inject unintended values into the credential helper protocol stream, causing the credential helper to retrieve the password for one server (e.g., good.example.com) for an HTTP request being made to another server (e.g., evil.example.com), resulting in credentials for the former being sent to the latter. There are no restrictions on the relationship between the two, meaning that an attacker can craft a URL that will present stored credentials for any host to a host of their choosing. The vulnerability can be triggered by feeding a malicious URL to git clone. However, the affected URLs look rather suspicious; the likely vector would be through systems which automatically clone URLs not visible to the user, such as Git submodules, or package systems built around Git. The problem has been patched in the versions published on April 14th, 2020, going back to v2.17.x. Anyone wishing to backport the change further can do so by applying commit 9a6bbee (the full release includes extra checks for git fsck, but that commit is sufficient to protect clients against the vulnerability). The patched versions are: 2.17.4, 2.18.3, 2.19.4, 2.20.3, 2.21.2, 2.22.3, 2.23.2, 2.24.2, 2.25.3, 2.26.1.
https://nvd.nist.gov/vuln/detail/CVE-2020-5260

Categories

CWE-20 : Improper Input Validation
The product receives input or data, but it doesnot validate or incorrectly validates that the input has theproperties that are required to process the data safely andcorrectly. When custom input validation is required, such as when enforcing business rules, manual analysis is necessary to ensure that the validation is properly implemented. Fuzzing techniques can be useful for detecting input validation errors. When unexpected inputs are provided to the software, the software should not crash or otherwise become unstable, and it should generate application-controlled error messages. If exceptions or interpreter-generated error messages occur, this indicates that the input was not detected and handled within the application logic itself. Consider using language-theoretic security (LangSec) techniques that characterize inputs using a formal language and build "recognizers" for that language. This effectively requires parsing to be a distinct layer that effectively enforces a boundary between raw input and internal data representations, instead of allowing parser code to be scattered throughout the program, where it could be subject to errors or inconsistencies that create weaknesses. [REF-1109] [REF-1110] [REF-1111] Use an input validation framework such as Struts or the OWASP ESAPI Validation API. Note that using a framework does not automatically address all input validation problems; be mindful of weaknesses that could arise from misusing the framework itself (CWE-1173). Understand all the potential areas where untrusted inputs can enter the product, including but not limited to: parameters or arguments, cookies, anything read from the network, environment variables, reverse DNS lookups, query results, request headers, URL components, e-mail, files, filenames, databases, and any external systems that provide data to the application. Remember that such inputs may be obtained indirectly through API calls. When your application combines data from multiple sources, perform the validation after the sources have been combined. The individual data elements may pass the validation step but violate the intended restrictions after they have been combined. Be especially careful to validate all input when invoking code that crosses language boundaries, such as from an interpreted language to native code. This could create an unexpected interaction between the language boundaries. Ensure that you are not violating any of the expectations of the language with which you are interfacing. For example, even though Java may not be susceptible to buffer overflows, providing a large argument in a call to native code might trigger an overflow. Directly convert your input type into the expected data type, such as using a conversion function that translates a string into a number. After converting to the expected data type, ensure that the input's values fall within the expected range of allowable values and that multi-field consistencies are maintained. When exchanging data between components, ensure that both components are using the same character encoding. Ensure that the proper encoding is applied at each interface. Explicitly set the encoding you are using whenever the protocol allows you to do so. Large language model (LLM) management tool does notvalidate the format of a digest value (CWE-1287) from aprivate, untrusted model registry, enabling relativepath traversal (CWE-23), a.k.a. Probllama Chain: a learning management tool debugger uses external input to locate previous session logs (CWE-73) and does not properly validate the given path (CWE-20), allowing for filesystem path traversal using "../" sequences (CWE-24) Chain: improper input validation (CWE-20) leads to integer overflow (CWE-190) in mobile OS, as exploited in the wild per CISA KEV. Chain: improper input validation (CWE-20) leads to integer overflow (CWE-190) in mobile OS, as exploited in the wild per CISA KEV. Chain: backslash followed by a newline can bypass a validation step (CWE-20), leading to eval injection (CWE-95), as exploited in the wild per CISA KEV. Chain: insufficient input validation (CWE-20) in browser allows heap corruption (CWE-787), as exploited in the wild per CISA KEV. Chain: improper input validation (CWE-20) in username parameter, leading to OS command injection (CWE-78), as exploited in the wild per CISA KEV. Chain: security product has improper input validation (CWE-20) leading to directory traversal (CWE-22), as exploited in the wild per CISA KEV. Improper input validation of HTTP requests in IP phone, as exploited in the wild per CISA KEV. Chain: improper input validation (CWE-20) in firewall product leads to XSS (CWE-79), as exploited in the wild per CISA KEV. Chain: caching proxy server has improper input validation (CWE-20) of headers, allowing HTTP response smuggling (CWE-444) using an "LF line ending" Eval injection in Perl program using an ID that should only contain hyphens and numbers. SQL injection through an ID that was supposed to be numeric. lack of input validation in spreadsheet program leads to buffer overflows, integer overflows, array index errors, and memory corruption. insufficient validation enables XSS driver in security product allows code execution due to insufficient validation infinite loop from DNS packet with a label that points to itself infinite loop from DNS packet with a label that points to itself missing parameter leads to crash HTTP request with missing protocol version number leads to crash request with missing parameters leads to information exposure system crash with offset value that is inconsistent with packet size size field that is inconsistent with packet size leads to buffer over-read product uses a denylist to identify potentially dangerous content, allowing attacker to bypass a warning security bypass via an extra header empty packet triggers reboot incomplete denylist allows SQL injection NUL byte in theme name causes directory traversal impact to be worse kernel does not validate an incoming pointer before dereferencing it anti-virus product has insufficient input validation of hooked SSDT functions, allowing code execution anti-virus product allows DoS via zero-length field driver does not validate input from userland to the kernel kernel does not validate parameters sent in from userland, allowing code execution lack of validation of string length fields allows memory consumption or buffer over-read lack of validation of length field leads to infinite loop lack of validation of input to an IOCTL allows code execution zero-length attachment causes crash zero-length input causes free of uninitialized pointer crash via a malformed frame structure infinite loop from a long SMTP request router crashes with a malformed packet packet with invalid version number leads to NULL pointer dereference crash via multiple "." characters in file extension

CWE-522 : Insufficiently Protected Credentials
The product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval. Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.) Use an appropriate security mechanism to protect the credentials. Make appropriate use of cryptography to protect the credentials. Use industry standards to protect the credentials (e.g. LDAP, keystore, etc.). A messaging platform serializes all elements of User/Group objects, making private information available to adversaries Initialization file contains credentials that can be decoded using a "simple string transformation" Python-based RPC framework enables pickle functionality by default, allowing clients to unpickle untrusted data. Programmable Logic Controller (PLC) sends sensitive information in plaintext, including passwords and session tokens. Building Controller uses a protocol that transmits authentication credentials in plaintext. Programmable Logic Controller (PLC) sends password in plaintext. Remote Terminal Unit (RTU) uses a driver that relies on a password stored in plaintext. Web app allows remote attackers to change the passwords of arbitrary users without providing the original password, and possibly perform other unauthorized actions. Web application password change utility doesn't check the original password. product authentication succeeds if user-provided MD5 hash matches the hash in its database; this can be subjected to replay attacks. chain: product generates predictable MD5 hashes using a constant value combined with username, allowing authentication bypass.

References

af854a3a-2127-422b-91ae-364da2661108 Patch

http://lists.opensuse.org/opensuse-security-announce/2020-04/msg00027.html
Third Party Advisory
http://lists.opensuse.org/opensuse-security-announce/2020-05/msg00003.html
Third Party Advisory
http://packetstormsecurity.com/files/157250/Git-Credential-Helper-Protocol-Ne...
Third Party Advisory VDB Entry
http://www.openwall.com/lists/oss-security/2020/04/15/5
Mailing List
http://www.openwall.com/lists/oss-security/2020/04/15/6
Mailing List Third Party Advisory
http://www.openwall.com/lists/oss-security/2020/04/20/1
Mailing List Third Party Advisory
https://github.com/git/git/commit/9a6bbee8006c24b46a85d29e7b38cfa79e9ab21b
Patch Third Party Advisory
https://github.com/git/git/security/advisories/GHSA-qm7j-c969-7j4q
Mitigation Patch Third Party Advisory
https://lists.debian.org/debian-lts-announce/2020/04/msg00010.html
Mailing List Third Party Advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedora...
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedora...
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedora...
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedora...
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedora...
https://lore.kernel.org/git/xmqqy2qy7xn8.fsf%40gitster.c.googlers.com/
https://security.gentoo.org/glsa/202004-13
Third Party Advisory
https://support.apple.com/kb/HT211141
Third Party Advisory
https://usn.ubuntu.com/4329-1/
Third Party Advisory
https://www.debian.org/security/2020/dsa-4657
Third Party Advisory

security-advisories@github.com Patch

http://lists.opensuse.org/opensuse-security-announce/2020-04/msg00027.html
Third Party Advisory
http://lists.opensuse.org/opensuse-security-announce/2020-05/msg00003.html
Third Party Advisory
http://packetstormsecurity.com/files/157250/Git-Credential-Helper-Protocol-Ne...
Third Party Advisory VDB Entry
http://www.openwall.com/lists/oss-security/2020/04/15/5
Mailing List
http://www.openwall.com/lists/oss-security/2020/04/15/6
Mailing List Third Party Advisory
http://www.openwall.com/lists/oss-security/2020/04/20/1
Mailing List Third Party Advisory
https://github.com/git/git/commit/9a6bbee8006c24b46a85d29e7b38cfa79e9ab21b
Patch Third Party Advisory
https://github.com/git/git/security/advisories/GHSA-qm7j-c969-7j4q
Mitigation Patch Third Party Advisory
https://lists.debian.org/debian-lts-announce/2020/04/msg00010.html
Mailing List Third Party Advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedora...
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedora...
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedora...
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedora...
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedora...
https://lore.kernel.org/git/xmqqy2qy7xn8.fsf%40gitster.c.googlers.com/
https://security.gentoo.org/glsa/202004-13
Third Party Advisory
https://support.apple.com/kb/HT211141
Third Party Advisory
https://usn.ubuntu.com/4329-1/
Third Party Advisory
https://www.debian.org/security/2020/dsa-4657
Third Party Advisory


 

CPE

cpe start end
Configuration 1
cpe:2.3:a:git:git:*:*:*:*:*:*:*:* < 2.17.4
cpe:2.3:a:git:git:*:*:*:*:*:*:*:* >= 2.22.0 < 2.22.3
cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:* >= 2.18.0 < 2.18.3
cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:* >= 2.19.0 < 2.19.4
cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:* >= 2.20.0 < 2.20.3
cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:* >= 2.21.0 < 2.21.2
cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:* >= 2.23.0 < 2.23.2
cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:* >= 2.24.0 < 2.24.2
cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:* >= 2.25.0 < 2.25.3
cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:* >= 2.26.0 < 2.26.1
Configuration 2
cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:lts:*:*:*
cpe:2.3:o:canonical:ubuntu_linux:18.04:*:*:*:lts:*:*:*
cpe:2.3:o:canonical:ubuntu_linux:19.10:*:*:*:*:*:*:*
cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*
cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*
cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*
cpe:2.3:o:fedoraproject:fedora:30:*:*:*:*:*:*:*
cpe:2.3:o:fedoraproject:fedora:31:*:*:*:*:*:*:*
cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:*
cpe:2.3:o:opensuse:leap:15.1:*:*:*:*:*:*:*


REMEDIATION


Patch

Url
https://github.com/git/git/commit/9a6bbee8006c24b46a85d29e7b38cfa79e9ab21b
https://github.com/git/git/security/advisories/GHSA-qm7j-c969-7j4q
https://github.com/git/git/commit/9a6bbee8006c24b46a85d29e7b38cfa79e9ab21b
https://github.com/git/git/security/advisories/GHSA-qm7j-c969-7j4q


EXPLOITS


Exploit-db.com

id description date
No known exploits

POC Github

Url
No known exploits

Other Nist (github, ...)

Url
No known exploits


CAPEC


Common Attack Pattern Enumerations and Classifications

id description severity
10 Buffer Overflow via Environment Variables
High
101 Server Side Include (SSI) Injection
High
109 Object Relational Mapping Injection
High
110 SQL Injection through SOAP Parameter Tampering
Very High
104 Cross Zone Scripting
High
108 Command Line Execution through SQL Injection
Very High
120 Double Encoding
Medium
13 Subverting Environment Variable Values
Very High
135 Format String Injection
High
136 LDAP Injection
High
14 Client-side Injection-induced Buffer Overflow
High
153 Input Data Manipulation
Medium
182 Flash Injection
Medium
209 XSS Using MIME Type Mismatch
Medium
22 Exploiting Trust in Client
High
23 File Content Injection
Very High
230 Serialized Data with Nested Payloads
High
231 Oversized Serialized Data Payloads
High
24 Filter Failure through Buffer Overflow
High
250 XML Injection
261 Fuzzing for garnering other adjacent user/sensitive data
Medium
267 Leverage Alternate Encoding
High
28 Fuzzing
Medium
3 Using Leading 'Ghost' Character Sequences to Bypass Input Filters
Medium
31 Accessing/Intercepting/Modifying HTTP Cookies
High
42 MIME Conversion
High
43 Exploiting Multiple Input Interpretation Layers
High
45 Buffer Overflow via Symbolic Links
High
46 Overflow Variables and Tags
High
47 Buffer Overflow via Parameter Expansion
High
473 Signature Spoof
52 Embedding NULL Bytes
High
53 Postfix, Null Terminate, and Backslash
High
588 DOM-Based XSS
Very High
63 Cross-Site Scripting (XSS)
Very High
64 Using Slashes and URL Encoding Combined to Bypass Validation Logic
High
664 Server Side Request Forgery
High
67 String Format Overflow in syslog()
Very High
7 Blind SQL Injection
High
71 Using Unicode Encoding to Bypass Validation Logic
High
72 URL Encoding
High
73 User-Controlled Filename
High
78 Using Escaped Slashes in Alternate Encoding
High
79 Using Slashes in Alternate Encoding
High
8 Buffer Overflow in an API Call
High
80 Using UTF-8 Encoding to Bypass Validation Logic
High
81 Web Server Logs Tampering
High
83 XPath Injection
High
85 AJAX Footprinting
Low
88 OS Command Injection
High
9 Buffer Overflow in Local Command-Line Utilities
High
102 Session Sidejacking
High
474 Signature Spoofing by Key Theft
High
50 Password Recovery Exploitation
High
509 Kerberoasting
High
551 Modify Existing Service
555 Remote Services with Stolen Credentials
Very High
560 Use of Known Domain Credentials
High
561 Windows Admin Shares with Stolen Credentials
600 Credential Stuffing
High
644 Use of Captured Hashes (Pass The Hash)
High
645 Use of Captured Tickets (Pass The Ticket)
High
652 Use of Known Kerberos Credentials
High
653 Use of Known Operating System Credentials
High


MITRE


Techniques

id description
T1021 Remote Services
T1021.002 Remote Services:SMB/Windows Admin Shares
T1027 Obfuscated Files or Information
T1036.001 Masquerading: Invalid Code Signature
T1078 Valid Accounts
T1110.004 Brute Force:Credential Stuffing
T1114.002 Email Collection:Remote Email Collection
T1133 External Remote Services
T1539 Steal Web Session Cookie
T1543 Create or Modify System Process
T1550.002 Use Alternate Authentication Material:Pass The Hash
T1550.003 Use Alternate Authentication Material:Pass The Ticket
T1552.004 Unsecured Credentials: Private Keys
T1553.002 Subvert Trust Controls:Code Signing
T1558 Steal or Forge Kerberos Tickets
T1558.003 Steal or Forge Kerberos Tickets:Kerberoasting
T1562.003 Impair Defenses:Impair Command History Logging
T1574.006 Hijack Execution Flow:Dynamic Linker Hijacking
T1574.007 Hijack Execution Flow:Path Interception by PATH Environment Variable
© 2022 The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation.

Mitigations

id description
M1018 Limit the accounts that may use remote services. Limit the permissions for accounts that are at higher risk of compromise; for example, configure SSH so users can only run specific programs.
M1026 Deny remote use of local admin credentials to log into systems. Do not allow domain user accounts to be in the local Administrators group multiple systems.
M1017 Ensure that a finite amount of ingress points to a software deployment system exist with restricted access for those required to allow and enable newly deployed software.
M1045 Require signed binaries.
M1017 Applications may send push notifications to verify a login as a form of multi-factor authentication (MFA). Train users to only accept valid push notifications and to report suspicious push notifications.
M1018 Proactively reset accounts that are known to be part of breached credentials either immediately, or after detecting bruteforce attempts.
M1060 Use secure out-of-band authentication methods to verify the authenticity of critical actions initiated via email, such as password resets, financial transactions, or access requests. For highly sensitive information, utilize out-of-band communication channels instead of relying solely on email. This reduces the risk of sensitive data being collected through compromised email accounts. Set up out-of-band alerts to notify security teams of unusual email activities, such as mass forwarding or large attachments being sent, which could indicate email collection attempts. Create plans for leveraging a secure out-of-band communications channel, rather than an existing in-network email server, in case of a security incident.
M1030 Deny direct remote access to internal systems through the use of network proxies, gateways, and firewalls.
M1017 Train users to identify aspects of phishing attempts where they're asked to enter credentials into a site that has the incorrect domain for the application they are logging into. Additionally, train users not to run untrusted JavaScript in their browser, such as by copying and pasting code or dragging and dropping bookmarklets.
M1018 Limit privileges of user accounts and groups so that only authorized administrators can interact with system-level process changes and service configurations.
M1018 Do not allow a domain user to be in the local administrator group on multiple systems.
M1018 Do not allow a user to be a local administrator for multiple systems.
M1022 Ensure permissions are properly set on folders containing sensitive private keys to prevent unintended access. Additionally, on Cisco devices, set the `nonexportable` flag during RSA key pair generation.
M1026 Limit domain admin account permissions to domain controllers and limited servers. Delegate other admin functions to separate accounts. Limit service accounts to minimal required privileges, including membership in privileged groups such as Domain Administrators.
M1026 Limit service accounts to minimal required privileges, including membership in privileged groups such as Domain Administrators.
M1028 Make sure that the <code>HISTCONTROL</code> environment variable is set to “ignoredups” instead of “ignoreboth” or “ignorespace”.
M1028 When System Integrity Protection (SIP) is enabled in macOS, the aforementioned environment variables are ignored when executing protected binaries. Third-party applications can also leverage Apple’s Hardened Runtime, ensuring these environment variables are subject to imposed restrictions. Admins can add restrictions to applications by setting the setuid and/or setgid bits, use entitlements, or have a __RESTRICT segment in the Mach-O binary.
M1022 Ensure that proper permissions and directory access control are set to deny users the ability to write files to the top-level directory <code>C:</code> and system directories, such as <code>C:Windows</code>, to reduce places where malicious files could be placed for execution. Require that all executables be placed in write-protected directories.
© 2022 The MITRE Corporation. Esta obra se reproduce y distribuye con el permiso de The MITRE Corporation.