Sceawere
Vulnerability Detail
CVE-2026-76221UPDATED Verified Sceawere Triage Sources: NVD / CISA KEV
GitPython Config-Name Injection Vulnerability
Vulnerability Metadata
- Severity
- High
- Score / CVSS
- 8.8
- Creation Date
- 3h ago
- Vendor
- gitpython-developers
- Product
- GitPython
- Attack Type
- Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
- Vector String
- CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Attack Complexity
- LOW
Narrative and Response
Description
GitPython before 3.1.58 contains a config-name injection vulnerability in the option-name validator that allows attackers to forge arbitrary git-config directives by injecting equals signs, hash symbols, and whitespace into option names. Attackers can inject malicious option names like 'sshCommand = touch /tmp/RCE #' to execute arbitrary commands via core.sshCommand or core.hooksPath on the next git operation.
Executive Summary
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Technical Details
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Mitigations
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
References
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Additional Metadata
{
"score": "8.8",
"pubDate": "2026-08-19T14:17:48.463Z",
"pubdate": "2026-08-19T14:17:48.463Z",
"executiveSummary": "GitPython before 3.1.58 suffers from a config-name injection vulnerability residing within the option-name validator component. This security flaw enables threat actors to forge arbitrary git-config directives by systematically injecting control characters, specifically equals signs, hash symbols, and whitespace, into option names.\nThe primary impact of this vulnerability is Remote Code Execution (RCE). By supplying maliciously crafted option names such as 'sshCommand = touch /tmp/RCE #', an attacker can manipulate underlying configuration parameters like core.sshCommand or core.hooksPath. Consequently, this leads to the execution of arbitrary system commands upon the execution of the next git operation.\nThe affected product is GitPython in versions prior to 3.1.58. The risk implications are severe, as successful exploitation compromises the integrity and confidentiality of the host system executing the vulnerable Python application.\nAttacker capabilities include arbitrary command execution within the security context of the user running the GitPython operations. Exploitation requirements involve the ability to supply or influence option names processed by the vulnerable validator within the GitPython library, typically through application logic that accepts untrusted input for git configuration tasks.",
"technicalDetails": "The root cause of the vulnerability lies in insufficient input sanitization and validation within the option-name validator of GitPython. The validator fails to adequately restrict or neutralize special characters such as equals signs ('='), hash symbols ('#'), and whitespace characters when processing configuration option names.\nThe vulnerable component is the option-name validator handling git-config directives in GitPython versions prior to 3.1.58. Because the parser or validator permits these delimiter and comment characters within the option name string, an attacker can prematurely close the expected option identifier and introduce new configuration keys and values.\nExploitation occurs when an attacker passes a specially crafted malicious string into the option-name parameter. For example, injecting a payload structured as 'sshCommand = touch /tmp/RCE #' alters the intended configuration stream. When GitPython constructs and executes the underlying git commands, the injected configuration directive overrides or appends settings such as core.sshCommand or core.hooksPath.\nThe attack flow proceeds as follows: First, the attacker identifies an injection vector where untrusted input is processed by GitPython's configuration handling functions. Second, the attacker crafts a payload containing configuration delimiters that bypass the weak option-name validator. Third, the crafted input is ingested by the library, generating a modified git configuration file or command-line argument list. Finally, upon the invocation of the subsequent git operation by the application, the injected configuration parameter is parsed and executed by the native Git binary, resulting in the execution of arbitrary payloads on the host operating system.\nThe payload behavior leverages native Git mechanisms, such as invoking external commands via core.sshCommand during network transport or executing scripts via core.hooksPath during repository events, thereby achieving post-exploitation impact ranging from local file manipulation to full system compromise depending on the privileges of the running process."
}