CVE-2024-32002
Git's recursive clones on case-insensitive filesystems that support symlinks are susceptible to Remote Code Execution
In short
Git can be tricked into writing files to wrong locations during submodule cloning on case-insensitive filesystems with symlink support, allowing attackers to execute malicious code automatically before the user can review it.
Technical detail
CVE-2024-32002 exploits path traversal (CWE-22) and arbitrary file upload (CWE-434) vulnerabilities in Git's submodule handling. A crafted repository with malicious submodules can cause Git to write files into `.git/` directories instead of intended worktree paths, enabling execution of hooks during active clone operations. Attack requires cloning from attacker-controlled repo on case-insensitive filesystems with symlink support enabled.
Summary generated and translated by AI from the official description.
Git is a revision control system. Prior to versions 2.45.1, 2.44.1, 2.43.4, 2.42.2, 2.41.1, 2.40.2, and 2.39.4, 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. The problem has been patched in versions 2.45.1, 2.44.1, 2.43.4, 2.42.2, 2.41.1, 2.40.2, and 2.39.4. 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.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
Affected products
git · gitpublic PoCs found — 70
githubgithub.com/amalmurali47/git_rce★ 532githubgithub.com/safebuffer/CVE-2024-32002★ 109githubgithub.com/amalmurali47/hook★ 18githubgithub.com/M507/CVE-2024-32002★ 9githubgithub.com/YukaFake/CVE-2024-32002-Reverse-Shell★ 6githubgithub.com/jweny/CVE-2024-32002_EXP★ 3githubgithub.com/jweny/CVE-2024-32002_HOOK★ 3githubgithub.com/NishanthAnand21/CVE-2024-32002-PoC★ 3githubgithub.com/10cks/CVE-2024-32002-EXP★ 2githubgithub.com/bfengj/CVE-2024-32002-Exploit★ 2githubgithub.com/markuta/CVE-2024-32002★ 2githubgithub.com/BasyacatX/CVE-2024-32002-PoC_Chinese★ 2githubgithub.com/10cks/hook★ 1githubgithub.com/Goplush/CVE-2024-32002-git-rce★ 1githubgithub.com/jakob-pennington/cve-2024-32002-poc-rce★ 1githubgithub.com/grecosamuel/CVE-2024-32002★ 1githubgithub.com/BohemianHacks/CVE-2024-32002-poc★ 1githubgithub.com/th4s1s/CVE-2024-32002-PoC★ 1githubgithub.com/fadhilthomas/poc-cve-2024-32002★ 1githubgithub.com/CrackerCat/CVE-2024-32002_EXP★ 1githubgithub.com/fadhilthomas/hook★ 0githubgithub.com/jakob-pennington/cve-2024-32002-submodule-aw★ 0githubgithub.com/jakob-pennington/cve-2024-32002-poc-aw★ 0githubgithub.com/431m/rcetest★ 0githubgithub.com/AD-Appledog/CVE-2024-32002★ 0githubgithub.com/AD-Appledog/wakuwaku★ 0githubgithub.com/tobelight/cve_2024_32002★ 0githubgithub.com/sysonlai/CVE-2024-32002-hook★ 0githubgithub.com/TSY244/CVE-2024-32002-git-rce-father-poc★ 0githubgithub.com/blackninja23/CVE-2024-32002★ 0githubgithub.com/daemon-reconfig/CVE-2024-32002★ 0githubgithub.com/charlesgargasson/CVE-2024-32002★ 0githubgithub.com/FlojBoj/CVE-2024-32002★ 0githubgithub.com/SpycioKon/CVE-2024-32002★ 0githubgithub.com/chrisWalker11/running-CVE-2024-32002-locally-for-tesing★ 0githubgithub.com/sanan2004/CVE-2024-32002★ 0githubgithub.com/Masamuneee/hook★ 0githubgithub.com/Masamuneee/CVE-2024-32002-POC★ 0githubgithub.com/jolibb55/donald★ 0githubgithub.com/ashutosh0408/CVE-2024-32002★ 0githubgithub.com/ashutosh0408/Cve-2024-32002-poc★ 0githubgithub.com/Dre4m017/fuzzy★ 0githubgithub.com/JoaoLeonello/cve-2024-32002-poc★ 0githubgithub.com/srakkk/cve-2024-32002-demo★ 0githubgithub.com/srakkk/cve-2024-32002-hook★ 0githubgithub.com/DayDayDayDreaming/backup-exec-hook★ 0githubgithub.com/DayDayDayDreaming/backup-exec-cve-32002★ 0githubgithub.com/ControlO8/CVE-2024-32002★ 0githubgithub.com/ControlO8/CVE-2024-32002-hook★ 0githubgithub.com/Roronoawjd/git_rce★ 0githubgithub.com/TSY244/CVE-2024-32002-git-rce★ 0githubgithub.com/aitorcastel/poc_CVE-2024-32002_submodule★ 0githubgithub.com/markuta/hooky★ 0githubgithub.com/jakob-pennington/cve-2024-32002-submodule-rce★ 0githubgithub.com/10cks/CVE-2024-32002-POC★ 0githubgithub.com/10cks/CVE-2024-32002-hulk★ 0githubgithub.com/10cks/CVE-2024-32002-submod★ 0githubgithub.com/10cks/CVE-2024-32002-smash★ 0githubgithub.com/10cks/CVE-2024-32002-linux-hulk★ 0githubgithub.com/10cks/CVE-2024-32002-linux-submod★ 0githubgithub.com/10cks/CVE-2024-32002-linux-smash★ 0githubgithub.com/aitorcastel/poc_CVE-2024-32002★ 0githubgithub.com/Roronoawjd/hook★ 0githubgithub.com/1mxml/CVE-2024-32002-poc★ 0githubgithub.com/bfengj/CVE-2024-32002-hook★ 0githubgithub.com/vincepsh/CVE-2024-32002★ 0githubgithub.com/vincepsh/CVE-2024-32002-hook★ 0githubgithub.com/YukaFake/CVE-2024-32002★ 0githubgithub.com/WOOOOONG/CVE-2024-32002★ 0githubgithub.com/WOOOOONG/hook★ 0⚠ Public resources, to assess the exposure of systems you control or are authorized to test. Test only with authorization.
Want to know if your infrastructure is exposed to this?
Talk to TrueHacking →References
https://github.com/git/git/commit/97065761333fd62db1912d81b489db938d8c991dhttps://github.com/git/git/security/advisories/GHSA-8h77-4q3w-gfgvhttps://git-scm.com/docs/git-clone#Documentation/git-clone.txt---recurse-submodulesltpathspecgthttps://git-scm.com/docs/git-config#Documentation/git-config.txt-coresymlinkshttps://lists.debian.org/debian-lts-announce/2024/06/msg00018.htmlhttps://lists.debian.org/debian-lts-announce/2024/09/msg00009.htmlhttps://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/S4CK4IYTXEOBZTEM5K3T6LWOIZ3S44AR/http://www.openwall.com/lists/oss-security/2024/05/14/2