
GIT vulnerability | Carriage Return and RCE on cloning
CVE-2025-48384 is a critical vulnerability in Git, the widely used distributed version control system. It involves improper handling of carriage return (CR) characters in configuration values, which can lead to path traversal issues during submodule checkouts. This flaw allows for potential arbitrary code execution under specific conditions. The vulnerability was publicly disclosed on July 8, 2025, and last modified on August 26, 2025. It has been added to the U.S. Cybersecurity and Infrastructure Security Agency (CISA) Known Exploited Vulnerabilities (KEV) catalog on August 25, 2025, indicating active exploitation in the wild, with a remediation due date of September 15, 2025.
The issue stems from how Git processes configuration values:
This discrepancy can cause a submodule to be checked out to an incorrect location if its path includes a trailing CR. If an attacker sets up a symlink that points this altered path to the submodule's hooks directory—and the submodule contains an executable post-checkout hook—the hook script could be executed unintentionally after checkout, resulting in arbitrary code execution.
The vulnerability exploits an interpretation conflict in Git's config parsing:
.git/hooks/post-checkout), allowing execution of malicious hooks during operations like git submodule update or git clone --recurse-submodules.This is classified under:
The attack vector is network-based (AV:N), with high complexity (AC:H), low privileges required (PR:L), required user interaction (UI:R), and a changed scope (S:C), impacting confidentiality, integrity, and availability highly (C:H/I:H/A:H).
The vulnerability affects Git versions prior to the following patched releases:
It impacts Git on various platforms, including Linux, macOS, and Windows, but is particularly relevant in developer environments, CI/CD pipelines (e.g., GitHub Actions, GitLab CI), and anywhere Git submodules are cloned from untrusted repositories.
--recurse-submodules.CVSS details are not fully scored in NVD yet (CVSS 4.0 pending), but based on CVSS 3.1 metrics from the advisory, it aligns with a critical severity (estimated CVSS 8.8, as previously noted in broader CVE lists).
--recurse-submodules) from untrusted repositories.This vulnerability highlights the importance of secure handling in version control systems, especially with submodules. If you're using Git in a production or development environment, prioritize updating immediately, given the active exploitation status.
.gitmodules points to https://github.com/s41r4j/CVE-2025-48384-submodule.git, but the PoC rewrites it to a local copy for offline testing.Run:
bash scripts/poc.sh
What it does:
$HOME/flag.txt inside the container.malicious-submodule-repo/ to /tmp in the container.post-checkout hook if the path-confusion succeeds./tmp/flag.txt created by the hook.Notes:
sub^M (CR) stored as a gitlink; the sanitized path sub resolves via a symlink to .git/hooks, so the submodule’s tracked post-checkout lands as an actual hook and runs.bash scripts/update-gitlink.sh.