CVE-2025-54123

9.8 CRITICAL

📋 TL;DR

This CVE describes a critical command injection vulnerability in Hoverfly's middleware API endpoint that allows remote code execution. Attackers can execute arbitrary commands on systems running vulnerable Hoverfly versions (1.11.3 and prior) by sending malicious payloads to the /api/v2/hoverfly/middleware endpoint. Organizations using Hoverfly for API simulation/testing are affected.

💻 Affected Systems

Products:
  • Hoverfly
Versions: Versions 1.11.3 and prior
Operating Systems: All operating systems where Hoverfly runs
Default Config Vulnerable: ⚠️ Yes
Notes: The middleware API endpoint is enabled by default in affected versions. Systems using Hoverfly in production or exposed environments are at highest risk.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise with attacker gaining shell access, installing persistence mechanisms, accessing sensitive data, and pivoting to other systems in the network.

🟠

Likely Case

Remote code execution leading to data theft, service disruption, or cryptocurrency mining malware deployment.

🟢

If Mitigated

Limited impact if network segmentation, strict firewall rules, and least privilege principles are implemented.

🌐 Internet-Facing: HIGH - The vulnerable endpoint is accessible via API and can be exploited remotely without authentication.
🏢 Internal Only: HIGH - Even internally, the vulnerability allows lateral movement and privilege escalation within the network.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

The vulnerability requires no authentication and involves simple command injection techniques. Public exploit code is likely to emerge given the high CVSS score and RCE nature.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Version 1.12.0 and later

Vendor Advisory: https://github.com/SpectoLabs/hoverfly/commit/17e60a9bc78826deb4b782dca1c1abd3dbe60d40

Restart Required: Yes

Instructions:

1. Upgrade Hoverfly to version 1.12.0 or later. 2. Restart the Hoverfly service. 3. Verify the middleware API endpoint is disabled by default in the new version.

🔧 Temporary Workarounds

Disable middleware API endpoint

all

Manually disable the vulnerable /api/v2/hoverfly/middleware endpoint

Edit Hoverfly configuration to remove or disable middleware functionality
Set appropriate firewall rules to block access to the endpoint

Network segmentation and access control

linux

Restrict network access to Hoverfly instances

iptables -A INPUT -p tcp --dport 8888 -s trusted_ip -j ACCEPT
iptables -A INPUT -p tcp --dport 8888 -j DROP

🧯 If You Can't Patch

  • Implement strict network access controls to isolate Hoverfly instances from untrusted networks
  • Run Hoverfly with minimal privileges using non-root user accounts and container isolation

🔍 How to Verify

Check if Vulnerable:

Check Hoverfly version: hoverfly --version. If version is 1.11.3 or earlier, the system is vulnerable. Also check if middleware API endpoint is accessible.

Check Version:

hoverfly --version

Verify Fix Applied:

After upgrade, verify version is 1.12.0 or later with hoverfly --version. Confirm middleware API endpoint returns 404 or is disabled.

📡 Detection & Monitoring

Log Indicators:

  • Unusual POST requests to /api/v2/hoverfly/middleware
  • Suspicious command execution patterns in system logs
  • Unexpected process creation from Hoverfly service

Network Indicators:

  • Unusual outbound connections from Hoverfly host
  • Traffic patterns indicating command injection attempts to the middleware endpoint

SIEM Query:

source="hoverfly.log" AND (uri_path="/api/v2/hoverfly/middleware" OR message="middleware") AND (status!=404)

🔗 References

📤 Share & Export