Oct 1, 2026·5 min read·18 visits
GitPython versions up to 3.1.61 do not validate submodule update paths, allowing recursive checkouts to execute directory traversals and write files outside repository boundaries.
A path traversal vulnerability exists in GitPython when handling submodule updates recursively. If an attacker crafts a malicious repository with traversed paths or symbolic links in the submodule configuration, they can execute arbitrary file writes outside the parent repository's working directory. This can lead to system configuration modifications or arbitrary code execution.
GitPython is a popular Python library designed to interact with Git repositories by wrapping system Git command-line calls or implementing native functions.
The vulnerability tracked as GHSA-59CR-6R3X-644W is a technical flaw in the library's submodule handling mechanism. If an application uses GitPython to clone and recursively update an untrusted repository, an attacker can manipulate the submodule path structure to perform out-of-bounds file writes.
This behavior bypasses standard workspace containment barriers and can be leveraged to write files directly to critical folders on the host operating system. The flaw affects all versions of GitPython up to and including 3.1.61, and has been addressed in version 3.1.62.
In Git repositories, submodules are defined within the .gitmodules file, which maps local subdirectory paths to remote repository URLs. During a submodule update command such as repo.submodule_update(), GitPython resolves the destination filesystem path utilizing the abspath property of the Submodule class.
Prior to the patch in version 3.1.62, the abspath property resolved paths directly from the raw path attribute defined in the .gitmodules configuration or the repository index. This attribute was not checked against the parent repository's working tree boundary before initialization or update operations.
This lack of verification allows two primary traversal vectors. First, directory traversal sequences like ../ are evaluated literally, pointing target destinations outside the repository root. Second, if a checked-in symbolic link exists in the workspace, the submodule path resolution follows the symlink to external directories, causing subsequent git clone operations to write files directly to targeted system paths.
The vulnerability was fixed in commit 1ed0ebc2f2e74d979cdc367a4864a7731fdcc093 by overriding the abspath property in git/objects/submodule/base.py to enforce strict containment checks.
Below is the patched code structure implementing the path containment check:
@property
def abspath(self) -> PathLike:
root = self.repo.working_tree_dir
if root is None:
return super().abspath
path = root
for component in os.fspath(self._to_relative_path(self.repo, self.path)).split("/"):
path = join_path_native(path, component)
if osp.islink(path):
raise ValueError("Submodule checkout path %r contains a symbolic link" % self.path)
return pathThe implementation first retrieves the absolute parent repository working directory root. It then normalizes the submodule path via self._to_relative_path(self.repo, self.path), raising a ValueError if the path escapes the repository directory.
To prevent symlink traversal attacks, the method splits the normalized path into individual directory components. It validates each step of the resolved path with osp.islink(path). If any directory component along the path resolution is a symbolic link, the check immediately raises a ValueError to prevent arbitrary file writes.
An attack requires the victim to perform a recursive submodule update on an untrusted or attacker-controlled repository. An attacker constructs a repository with a .gitmodules file pointing to a hostile submodule containing a traversal path or a symbolic link pointing to a sensitive system folder.
The following Mermaid diagram outlines the path traversal attack flow during a recursive submodule update operation:
When submodule.update(init=True) is called in a vulnerable environment, GitPython invokes subprocesses that clone and write the submodule's repository structure directly into the target traversed or symlinked folder. No authentication is required other than the willingness of the user or automated pipeline to process the repository.
Successful exploitation of this vulnerability allows arbitrary file writes on the filesystem hosting the GitPython process. The exact impact depends on the execution environment and the privileges of the running application.
In environments where GitPython runs as a privileged user or within an automated continuous integration pipeline, this flaw can lead to remote code execution. An attacker can write malicious configurations, inject scripts into startup folders, or overwrite standard shell files like .bashrc or authorized SSH key lists.
The vulnerability is tracked under the GitHub Security Advisory GHSA-59CR-6R3X-644W. It does not have an assigned CVE identifier, which means automated scanners relying solely on standard CVE databases will fail to flag this issue.
The primary remediation path is upgrading the GitPython dependency to version 3.1.62 or later. This version enforces path normalization and symlink checks during submodule path resolution, raising errors before any external clone or write occurs.
If immediate upgrade is not feasible, organizations should implement strict workarounds. Applications must avoid running recursive submodule updates on untrusted, user-provided repositories. Running GitPython within sandboxed container environments with minimal write permissions to the parent host filesystem is highly recommended.
Additionally, static analysis can be utilized to scan incoming .gitmodules files and repository layouts for directory traversal sequences or symbolic links before invoking GitPython submodule APIs.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
GitPython gitpython-developers | <= 3.1.61 | 3.1.62 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-22, CWE-59 |
| Attack Vector | Local/Remote via User Interaction |
| CVSS Score | 8.8 |
| Impact | Arbitrary File Write / Code Execution |
| Exploit Status | Proof of Concept (PoC) |
| CISA KEV Status | Not Listed |
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
CVE-2026-128087 (GHSA-9264-jvgf-6w2f) is an incorrect behavior order (CWE-696) and improper authorization (CWE-863) vulnerability in the russh Rust SSH library, affecting versions 0.55.0 through 0.65.0. During the initial SSH key exchange (KEX) handshake, the client state machine invokes the client::Handler::kex_done() callback—providing the negotiated raw shared secret bytes—prior to validating the remote server's host key or certificate via check_server_key(). Consequently, an untrusted or rogue SSH server can complete cryptographic key agreement and force a connecting client to execute side-effecting application logic inside kex_done() before the server's identity is checked and rejected.
CVE-2026-128082 (GHSA-6vhm-j9h7-f9gh) is an uncontrolled recursion vulnerability (CWE-674) in AutoMapper, a convention-based object-object mapper for .NET. When mapping nested or self-referential types into destination models that rely on parameterized constructors, C# positional records, or recursive ConstructUsing expressions, AutoMapper evaluates child constructor arguments prior to incrementing the parent's recursion depth counter. This ordering flaw bypasses both explicit MaxDepth limits and the default depth limit of 64. An unauthenticated remote attacker can supply deeply nested input payloads to affected endpoints, exhausting the thread call stack and triggering an uncatchable System.StackOverflowException that terminates the hosting .NET process.
An information exposure vulnerability in the @opentelemetry/instrumentation-http package for OpenTelemetry JavaScript versions 0.204.0 prior to 0.222.0 causes incoming HTTP server spans to record raw, unredacted query string parameters under the url.query attribute. While outgoing client spans applied built-in and user-configured query parameter redaction, incoming server spans bypassed this sanitization completely, resulting in the transmission of sensitive credentials such as pre-signed cloud URLs and API tokens to external observability backends.
CVE-2026-128089 is an uncontrolled resource consumption vulnerability in the dnspython toolkit for Python, affecting all versions prior to 2.9.2. When parsing Well-Known Service (WKS) records from text via dns.rdtypes.IN.WKS.WKS.from_text(), the parser fails to validate that numeric service port identifiers fall within the RFC 1035 valid range of 0 through 65535. An attacker capable of supplying untrusted zone files or RDATA text strings containing an arbitrarily large service port integer can force the parser to allocate an unbounded bitmap array using an inefficient linear append loop, resulting in severe CPU exhaustion, application hangs, or Out-Of-Memory (OOM) process termination.
CVE-2026-126347 (GHSA-5cjw-f85j-cv6r) is an open redirect vulnerability (CWE-601) in Tornado, an asynchronous Python networking library and web framework. The flaw resides in tornado.web.RedirectHandler when dynamic URL redirection templates incorporate unvalidated user input. Due to a parser differential between RFC 3986 (used by Python's urllib.parse.urlsplit) and the WHATWG URL Standard (used by modern web browsers), inputs containing three or more leading slashes bypass Tornado 6.6.0's validation logic, allowing unauthenticated attackers to redirect users to arbitrary external domains.
A Denial of Service (DoS) vulnerability exists in @sveltejs/adapter-node versions 5.5.7 and 6.0.0-next.0 through 6.0.0. When a SvelteKit server route returns a direct response from a fetch() call with a Content-Type of text/event-stream, the Node.js adapter attempts to mutate the response headers to disable proxy buffering. Because headers returned directly by the WHATWG Fetch API carry an immutable guard, this mutation throws an unhandled TypeError, terminating the underlying Node.js process and denying service to all active and subsequent clients.