
Proof-of-Concept for CVE-2024-52005: ANSI escape sequence injection in Git. Demonstrates incorrect 'not_affected' VEX claims in hardened container images.
This repository contains a Proof-of-Concept (PoC) demonstrating CVE-2024-52005, a vulnerability in Git that allows ANSI escape sequence injection through the sideband channel during Git operations.
CVE-2024-52005 is a High severity (CVSS 7.5) vulnerability affecting Git versions prior to 2.48.1, 2.47.3, 2.46.5, 2.45.4, and 2.44.3.
This PoC was created to demonstrate that certain hardened container images incorrectly claim "not_affected" status in their VEX (Vulnerability Exploitability eXchange) documents, despite shipping vulnerable Git versions.
The vulnerability allows attackers to:
Test directly against DHI ArgoCD container using this GitHub repo:
docker run --rm -it dhi.io/argocd:3 sh -c '
git clone https://github.com/andrewd-cg/cve-2024-52005-poc.git /tmp/poc &&
cd /tmp/poc &&
sh docker-test.sh
'
This command:
If you see ^[[31m or ^[[32m in the output, the vulnerability is confirmed.
Clone the repo and run the test locally:
git clone https://github.com/andrewd-cg/cve-2024-52005-poc.git
cd cve-2024-52005-poc
./test_ansi_injection.sh
This script will:
# Create malicious repository with social engineering payload
./exploit_cve_2024_52005.py create social_engineering
# Test against vulnerable container
./exploit_cve_2024_52005.py test
# View results
cat -v /tmp/cve-2024-52005-output.log
Attacker creates public GitHub repo → ArgoCD clones it automatically →
Git hook injects ANSI codes → Hides backdoor in deployment logs
Developer clones repo → Malicious hook runs → Injects fake "Build PASSED" →
Real failures hidden → Vulnerable code deployed to production
Security scanner clones repo → Hook injects ANSI codes →
Shows "0 vulnerabilities" → Real vulnerabilities hidden →
Malicious code passes review
The framework includes 8 pre-built attack payloads:
Many container images claim "not_affected" for CVE-2024-52005 with the justification:
{
"justification": "vulnerable_code_cannot_be_controlled_by_adversary"
}
This is incorrect for containers designed to clone untrusted repositories:
The attacker does control the vulnerable code path through Git hooks and sideband messages.
Git versions affected by CVE-2024-52005:
Update to a patched version:
# Check your version
git --version
# Update via package manager
apt update && apt upgrade git # Debian/Ubuntu
brew upgrade git # macOS
If you cannot update immediately:
# Test any container image
docker run --rm -v $(pwd)/ansi-test-repo:/repo:ro YOUR_IMAGE:TAG \
sh -c 'git clone /repo /tmp/test 2>&1' | cat -v
# Look for ANSI codes like ^[[31m in the output
This PoC was created for:
For authorized security testing only. Do not use this against systems you don't own or have permission to test.
MIT License - See LICENSE file for details
Created as part of container image security research, demonstrating the importance of accurate vulnerability disclosure and assessment.
Found an issue or have improvements? Pull requests welcome!