Impact
Dulwich’s porcelain.checkout() uses raw os.open without the O_NOFOLLOW flag, allowing an attacker-controlled repository to create a symlink that points to any target file on the file system. When the checkout operation follows this symlink, the target file is overwritten with attacker-supplied data. In a typical exploitation scenario the attacker crafts a repository where the worktree symlink points to .git/hooks/post‑checkout, causing the checkout process to write a malicious hook that executes arbitrary code when subsequent checkouts occur. This flaw is a classic path‑traversal exploit (CWE‑59) and can lead to persistent command execution with the privileges of the user performing the checkout.
Affected Systems
The vulnerability affects Dulwich, developed by Jelmer and distributed as the Dulwich project. Versions 0.24.0 through 1.2.7 contain the flaw; version 1.2.8 and later contain the fix. Any environment that employs Dulwich to perform Git operations—such as applications that clone, pull, or checkout repositories—may be impacted if it processes untrusted or potentially malicious repositories.
Risk and Exploitability
The CVSS score of 7.3 describes a high severity issue, while the EPSS score of less than 1% indicates that, at present, exploitation likelihood is low. The flaw is not listed in CISA’s KEV catalog. Attackers must be able to supply a repository that contains the malicious symlink; the likely attack vector is cloning from or pulling from an attacker‑controlled repository in a continuous integration pipeline or similar environment. Based on the description, it is inferred that the attacker can embed the vulnerable symlink into the repository prior to the target performing a porcelain.checkout(), which then writes arbitrary content to .git/hooks/post‑checkout and achieves code execution with the checkout’s effective privileges.
OpenCVE Enrichment