{"description":"Trending threats, MITRE ATT\u0026CK coverage, and detection metadata. Fed continuously.","feed_url":"https://feed.craftedsignal.io/products/gitpython--3.1.52/feed.json","home_page_url":"https://feed.craftedsignal.io/","items":[{"_cs_actors":[],"_cs_cpes":[],"_cs_cves":[],"_cs_exploited":false,"_cs_has_poc":false,"_cs_poc_references":[],"_cs_products":["GitPython (\u003c= 3.1.52)"],"_cs_severities":["high"],"_cs_tags":["code-injection","rce","python","git","supply-chain"],"_cs_type":"advisory","_cs_vendors":[],"content_html":"\u003cp\u003eA high-severity vulnerability (GHSA-3rp5-jjmw-4wv2) exists in the GitPython library, affecting all versions up to and including 3.1.52. This flaw enables attackers to achieve remote code execution (RCE) on a victim's system. The vulnerability stems from insufficient neutralization of special characters (specifically \u003ccode\u003e]\u003c/code\u003e, \u003ccode\u003e[\u003c/code\u003e, and \u003ccode\u003e\u0026quot;\u003c/code\u003e) in Git configuration section names. An attacker can craft a malicious submodule name, which, when processed by GitPython's config writer, leads to the injection of arbitrary configuration directives into the victim's \u003ccode\u003e.git/config\u003c/code\u003e file. This can be exploited through two primary vectors: an application using \u003ccode\u003eRepo.create_submodule\u003c/code\u003e with untrusted input, or by cloning an untrusted repository followed by \u003ccode\u003esubmodule_update\u003c/code\u003e. Once injected, a directive like \u003ccode\u003ecore.sshCommand\u003c/code\u003e can execute arbitrary code when the victim performs a subsequent Git operation (e.g., fetch, pull, push) that utilizes SSH, posing a significant threat to developers and CI/CD pipelines.\u003c/p\u003e\n\u003ch2 id=\"attack-chain\"\u003eAttack Chain\u003c/h2\u003e\n\u003col\u003e\n\u003cli\u003eAn attacker crafts a malicious submodule name, such as \u003ccode\u003e'x\u0026quot;] [core] sshCommand=CMD #'\u003c/code\u003e, designed to close the legitimate \u003ccode\u003e[submodule \u0026quot;\u003c/code\u003e section and open a new \u003ccode\u003e[core]\u003c/code\u003e section with an injected \u003ccode\u003esshCommand\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eThe attacker convinces a victim to either use \u003ccode\u003eRepo.create_submodule\u003c/code\u003e with this malicious name (e.g., in a development tool or application accepting untrusted input) or to clone an untrusted Git repository containing this malicious submodule name in its \u003ccode\u003e.gitmodules\u003c/code\u003e file and then execute \u003ccode\u003esubmodule_update\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eGitPython's config writer (e.g., \u003ccode\u003efp.write((\u0026quot;[%s]\\n\u0026quot; % name).encode(defenc))\u003c/code\u003e) processes the crafted submodule name without adequately escaping the special characters.\u003c/li\u003e\n\u003cli\u003eThe malicious name is written into the victim's repository-local \u003ccode\u003e.git/config\u003c/code\u003e file, resulting in an entry like \u003ccode\u003e[submodule \u0026quot;x\u0026quot;] [core] sshCommand=CMD #\u0026quot;]\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eThe Git client parses this malformed entry, treating \u003ccode\u003e[core] sshCommand=CMD\u003c/code\u003e as a valid configuration directive due to the unescaped \u003ccode\u003e]\u003c/code\u003e closing the \u003ccode\u003esubmodule\u003c/code\u003e section and \u003ccode\u003e[\u003c/code\u003e opening a new \u003ccode\u003ecore\u003c/code\u003e section on the same line.\u003c/li\u003e\n\u003cli\u003eThe \u003ccode\u003ecore.sshCommand\u003c/code\u003e configuration is now set to an attacker-controlled command (e.g., \u003ccode\u003eCMD\u003c/code\u003e).\u003c/li\u003e\n\u003cli\u003eUpon the victim's next Git operation that requires SSH (e.g., \u003ccode\u003egit fetch\u003c/code\u003e, \u003ccode\u003egit pull\u003c/code\u003e, \u003ccode\u003egit push\u003c/code\u003e), the configured \u003ccode\u003ecore.sshCommand\u003c/code\u003e is executed by the system.\u003c/li\u003e\n\u003cli\u003eThe attacker's command \u003ccode\u003eCMD\u003c/code\u003e is executed on the victim's machine, achieving remote code execution.\u003c/li\u003e\n\u003c/ol\u003e\n\u003ch2 id=\"impact\"\u003eImpact\u003c/h2\u003e\n\u003cp\u003eSuccessful exploitation of this vulnerability grants attackers arbitrary code execution on the victim's system, operating under the privileges of the user executing the Git operation. This can lead to complete system compromise, data exfiltration, or further lateral movement within an organization's network. The attack is highly effective because it leverages Git's trusted configuration mechanism. It can be triggered by common Git operations like \u003ccode\u003efetch\u003c/code\u003e, \u003ccode\u003epull\u003c/code\u003e, or \u003ccode\u003epush\u003c/code\u003e that use SSH, affecting developers, CI/CD systems, and any environment processing Git repositories with GitPython. While primarily observed as a Unix vector for the \u003ccode\u003eclone_from\u003c/code\u003e + \u003ccode\u003esubmodule_update\u003c/code\u003e path, the direct \u003ccode\u003ecreate_submodule\u003c/code\u003e API sink remains exploitable across Windows, Linux, and macOS platforms.\u003c/p\u003e\n\u003ch2 id=\"recommendation\"\u003eRecommendation\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eUpgrade GitPython to a version greater than 3.1.52 immediately to remediate GHSA-3rp5-jjmw-4wv2.\u003c/li\u003e\n\u003cli\u003eImplement rigorous input validation and sanitization for any application that constructs Git submodules from untrusted input using \u003ccode\u003eRepo.create_submodule\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eEducate users to exercise caution when cloning or initializing submodules from untrusted or unfamiliar Git repositories, as this can be a vector for \u003ccode\u003ecore.sshCommand\u003c/code\u003e injection.\u003c/li\u003e\n\u003cli\u003eMonitor process creation logs for unusual commands executed by Git or SSH processes, as this could indicate RCE via an injected \u003ccode\u003ecore.sshCommand\u003c/code\u003e (requires enabling Sysmon or similar granular logging).\u003c/li\u003e\n\u003c/ul\u003e\n","date_modified":"2026-07-24T16:33:29Z","date_published":"2026-07-24T16:33:29Z","id":"https://feed.craftedsignal.io/briefs/2026-07-gitpython-config-injection/","summary":"A critical vulnerability in GitPython versions up to 3.1.52 allows attackers to inject arbitrary Git configuration directives into a victim's `.git/config` file by crafting a malicious submodule name, leading to remote code execution (RCE) during subsequent Git operations that trigger `core.sshCommand`.","title":"GitPython Arbitrary Config Injection via Submodule Name (GHSA-3rp5-jjmw-4wv2)","url":"https://feed.craftedsignal.io/briefs/2026-07-gitpython-config-injection/"}],"language":"en","title":"CraftedSignal Threat Feed - GitPython (\u003c= 3.1.52)","version":"https://jsonfeed.org/version/1.1"}