Skip to content

Recursive clones on case-insensitive filesystems that support symlinks are susceptible to Remote Code Execution

Critical
dscho published GHSA-8h77-4q3w-gfgv May 14, 2024

Package

git

Affected versions

v2.45.0 v2.44.0 <=v2.43.3 <=v2.42.1 v2.41.0 <=v2.40.1 <=v2.39.3

Patched versions

v2.45.1 v2.44.1 v2.43.4 v2.42.2 v2.41.1 v2.40.2 v2.39.4

Description

Impact

Repositories with submodules can be crafted in a way that exploits a bug in Git whereby it can be fooled into writing files not into the submodule's worktree but into a .git/ directory. This allows writing a hook that will be executed while the clone operation is still running, giving the user no opportunity to inspect the code that is being executed.

Patches

The problem has been patched in the versions published on Tuesday, May 14th, 2024.

Workarounds

If symbolic link support is disabled in Git (e.g. via git config --global core.symlinks false), the described attack won't work.

As always, it is best to avoid cloning repositories from untrusted sources.

References

Severity

Critical
9.1
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H

CVE ID

CVE-2024-32002

Credits