VYPR
Critical severityNVD Advisory· Published Sep 10, 2025· Updated Sep 10, 2025

Hoverfly vulnerable to remote code execution at `/api/v2/hoverfly/middleware` endpoint due to insecure middleware implementation

CVE-2025-54123

Description

Hoverfly is an open source API simulation tool. In versions 1.11.3 and prior, the middleware functionality in Hoverfly is vulnerable to command injection vulnerability at /api/v2/hoverfly/middleware endpoint due to insufficient validation and sanitization in user input. The vulnerability exists in the middleware management API endpoint /api/v2/hoverfly/middleware. This issue is born due to combination of three code level flaws: Insufficient Input Validation in middleware.go line 94-96; Unsafe Command Execution in local_middleware.go line 14-19; and Immediate Execution During Testing in hoverfly_service.go line 173. This allows an attacker to gain remote code execution (RCE) on any system running the vulnerable Hoverfly service. Since the input is directly passed to system commands without proper checks, an attacker can upload a malicious payload or directly execute arbitrary commands (including reverse shells) on the host server with the privileges of the Hoverfly process. Commit 17e60a9bc78826deb4b782dca1c1abd3dbe60d40 in version 1.12.0 disables the set middleware API by default, and subsequent changes to documentation make users aware of the security changes of exposing the set middleware API.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Hoverfly versions ≤ 1.11.3 have a command injection in the middleware API that allows unauthenticated RCE due to unsanitized user input being passed directly to system commands.

CVE-2025-54123 is a critical vulnerability in Hoverfly, an open source API simulation tool, that enables remote code execution via the /api/v2/hoverfly/middleware endpoint. The root cause is a combination of three flaws in the codebase: insufficient input validation in middleware.go (lines 94-96), where the Binary field is set without sanitization; unsafe command execution in local_middleware.go (lines 14-19), where user-supplied binary and script names are passed directly to exec.Command; and immediate execution during middleware validation in hoverfly_service.go (line 173), which triggers the command without proper checks [1][2][3].

An attacker can exploit this by sending a PUT request to the vulnerable endpoint with a malicious payload, such as a bash command or script. The Hoverfly service writes the script to a temporary file and executes it via /bin/bash /tmp/{hoverfly_script} during middleware validation. This attack requires network access to the Hoverfly admin API (default port 8888) and can be performed with no authentication if the API is exposed [2].

The impact is severe, as an attacker can execute arbitrary commands, deploy reverse shells, or compromise the host server with the privileges of the Hoverfly process. This could lead to full system compromise, data exfiltration, or further lateral movement within the network [1][2].

The fix was implemented in commit 17e60a9bc78826deb4b782dca1c1abd3dbe60d40 and released in version 1.12.0, which disables the set middleware API by default. Users must explicitly enable it using the --enable-middleware-api flag if needed. Organizations are strongly advised to upgrade to Hoverfly 1.12.0 or later and avoid exposing the admin API to untrusted networks [1][4].

AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
github.com/SpectoLabs/hoverflyGo
<= 1.11.3

Affected products

2

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

9

News mentions

0

No linked articles in our index yet.