CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-59CR-6R3X-644W

GHSA-59CR-6R3X-644W: GitPython Submodule Update Path Traversal Can Write Outside the Repository

Amit Schendel
Amit Schendel
Senior Security Researcher

Oct 1, 2026·5 min read·16 visits

Executive Summary (TL;DR)

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.

Vulnerability Overview

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.

Root Cause Analysis

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.

Code Analysis

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 path

The 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.

Exploitation Methodology

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.

Impact Assessment

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.

Remediation & Defenses

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.

Fix Analysis (1)

Technical Appendix

CVSS Score
8.8/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H

Affected Systems

Applications utilizing GitPython for repository handling and submodule synchronizationContinuous Integration/Continuous Deployment (CI/CD) pipelines executing automated git checkout actions

Affected Versions Detail

Product
Affected Versions
Fixed Version
GitPython
gitpython-developers
<= 3.1.613.1.62
AttributeDetail
CWE IDCWE-22, CWE-59
Attack VectorLocal/Remote via User Interaction
CVSS Score8.8
ImpactArbitrary File Write / Code Execution
Exploit StatusProof of Concept (PoC)
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1204.002User Execution: Malicious File
Execution
T1546.004Event Triggered Execution: .bashrc / .bash_profile
Persistence
T1036Masquerading
Defense Evasion
T1105Ingress Tool Transfer
Lateral Movement
CWE-22
Improper Limitation of a Pathname to a Restricted Directory

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Known Exploits & Detection

GitHub Security Advisory GHSA-59cr-6r3x-644wVulnerability details and regression tests validating path traversal and symlink checks

References & Sources

  • [1]GitHub Security Advisory GHSA-59CR-6R3X-644W
  • [2]GitPython Security Advisory
  • [3]Fix Commit
  • [4]Fix Pull Request
  • [5]GitPython 3.1.62 Release Notes

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 3 hours ago•CVE-2026-9639
6.5

CVE-2026-9639: Authenticated Denial of Service via Nil-Pointer Dereference in Canonical LXD Custom Volume Backup Import

CVE-2026-9639 (GHSA-j93m-3j9p-m5m8) is a null pointer dereference vulnerability in Canonical LXD affecting versions 5.0.0 through 5.21.4 and 6.0 through 6.8. The flaw resides in the (*lxdBackend).CreateCustomVolumeFromBackup method within lxd/storage/backend_lxd.go. An authenticated attacker with the can_create_storage_volumes permission can upload a crafted custom volume backup tarball that omits the expires_at field on a snapshot entry, triggering an unhandled SIGSEGV panic and terminating the LXD daemon.

Amit Schendel
Amit Schendel
5 views•9 min read
•about 4 hours ago•CVE-2026-33050
8.8

CVE-2026-33050: OS Command Injection in GeoNode Vector Upload Handler

An operating system command injection vulnerability (CWE-78) exists in GeoNode versions prior to 5.1.0. The vulnerability occurs in the vector upload processing pipeline when handling user-supplied geospatial files. By supplying a crafted layer name containing shell metacharacters, an authenticated attacker with basic data upload privileges can execute arbitrary commands on the underlying server or container hosting the GeoNode application and Celery worker processes.

Alon Barad
Alon Barad
5 views•9 min read
•about 5 hours ago•CVE-2026-46429
5.5

CVE-2026-46429: Unrestricted File Upload and Validation Bypass in GeoNode

GeoNode versions prior to 5.0.3 contain an unrestricted file upload vulnerability (CWE-434) within the document and dataset ingestion architecture. Authenticated low-privileged users can bypass upload validation via direct REST API interactions, file extension masquerading, metadata mutation via PATCH requests, or malicious archive submissions. This allows attackers to store and serve dangerous file types, alter on-disk file references, or trigger path traversal and resource exhaustion during archive extraction.

Amit Schendel
Amit Schendel
6 views•10 min read
•about 6 hours ago•CVE-2026-55649
6.3

CVE-2026-55649: Stored Cross-Site Scripting in GeoNode Document Metadata Abstract Field

CVE-2026-55649 is a stored Cross-Site Scripting (XSS) vulnerability in GeoNode versions prior to 5.0.3. The flaw exists because document abstract metadata fields are ingested via the metadata management pipeline and stored in the backend database without HTML sanitization or input neutralization. An authenticated attacker with privileges to create or edit document metadata can inject arbitrary HTML and JavaScript payloads into these fields. When another user, such as an administrator, views the affected document page or catalog listing, the unencoded payload is rendered into the Document Object Model (DOM) and executes within the victim's browser session.

Amit Schendel
Amit Schendel
7 views•9 min read
•about 7 hours ago•GHSA-QX75-2P3R-PWM5
7.7

CVE-2026-55622: Cross-Project Instance Copy Authorization Bypass in Canonical LXD and LXC Incus

CVE-2026-55622 (GHSA-qx75-2p3r-pwm5) is an improper access control vulnerability (CWE-284) in Canonical LXD and LXC Incus (tracked as GHSA-c9f5-j9c3-mhrg). In multi-tenant deployments utilizing project-based isolation, the REST API handler for instance creation via POST /1.0/instances verifies that the authenticated user has authorization in the destination project specified by the query parameter, but fails to verify whether the user holds read or view permissions for the source instance when executing a copy operation across projects. Consequently, an authenticated client restricted to a single project can clone instances or snapshots from unauthorized projects into their own project, resulting in complete disclosure of the target instance filesystem and embedded credentials.

Amit Schendel
Amit Schendel
6 views•11 min read
•about 8 hours ago•GHSA-7MR3-28H5-M5VX
7.7

GHSA-7mr3-28h5-m5vx: Authorization Bypass and Cross-Project Volume Copy in Canonical LXD

An authorization bypass vulnerability in Canonical LXD (tracked as GHSA-7mr3-28h5-m5vx and CVE-2026-55621, and as GHSA-64f3-v33m-w89f in Linux Containers Incus) allows an authenticated user with restricted project access to copy custom storage volumes and volume snapshots from unauthorized projects. The flaw resides in the storagePoolVolumesPost REST API handler, which verifies permissions on the destination project but fails to check whether the caller holds view entitlements on the source project or volume specified in the request body.

Alon Barad
Alon Barad
5 views•10 min read