Executive brief
Git, a widely used version control system for software development, contains a vulnerability in how it handles submodules. An attacker could trick a user into checking out a malicious repository that executes unauthorized code on the user's computer. This could lead to a full system compromise, theft of source code, or unauthorized access to development environments.
Technical details
A link following vulnerability (CWE-59) exists in Git due to an interpretation conflict (CWE-436) regarding carriage return (CR) characters in configuration files. When Git reads config values, it strips trailing CRLF, but when writing them, it fails to quote values with trailing CRs, causing the CR to be lost on subsequent reads. If a submodule path contains a trailing CR, Git may check out the submodule to an incorrect location. If an attacker places a symlink at that altered path pointing to the submodule's hooks directory, a malicious 'post-checkout' hook within the submodule can be executed automatically. This requires the victim to perform a checkout or clone operation on a specially crafted repository.
Affected products
- Git-SCM Git < 2.43.7, 2.44.0 to < 2.44.4, 2.45.0 to < 2.45.4, 2.46.0 to < 2.46.4, 2.47.0 to < 2.47.3, 2.48.0 to < 2.48.2, 2.49.0 to < 2.49.1, 2.50.0 to < 2.50.1
Timeline
- 2025-07-08: disclosed: Vulnerability reported by GitHub
- 2025-08-25: kev added: Added to CISA KEV catalog due to active exploitation
- 2025-08-25: advisory: NVD publication date