# CVE-2025-54123: Hoverfly is vulnerable to Remote Code Execution through an insecure middleware implementation

> Attackers can execute arbitrary commands on the host via the middleware API endpoint, leading to remote code execution.

- **Severity:** Critical 9.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 10 Sep 2025
- **Updated:** 10 Sep 2025
- **Also known as:** GHSA-r4h8-hfp2-ggmf, GO-2025-3944

## What is CVE-2025-54123?

CVE-2025-54123 is a critical command injection vulnerability in SpectoLabs hoverfly, published on 10 Sep 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-78 (Improper Neutralization of Special Elements used in an OS Command), CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2025-54123?

3 open source packages ship an affected version, including github.com/SpectoLabs/hoverfly. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/SpectoLabs/hoverfly` | Go | All versions | None |
| `github.com/SpectoLabs/hoverfly` | Go | All versions to 1.11.3 | None |
| `github.com/SpectoLabs/hoverfly` | Go | All versions to 1.11.3 | None |

Products: Hoverfly Hoverfly.

## How do I fix CVE-2025-54123?

Upgrade to a fixed version.

## Is CVE-2025-54123 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-54123 exists.

Public exploit code:

- CVE-2025-54123  Hoverfly Authenticated Middleware Command Injection RCE (github_poc): https://github.com/kasem545/CVE-2025-54123-Poc
- CVE-2025-54123 Hoverfly Command Injection to RCE PoC (github_poc): https://github.com/0xk4rth1/CVE-2025-54123
- https://github.com/0x00phantom-hat/Hoverfly-1.11.3-RCE-CVE-2025-54123-Exploit (github_poc): https://github.com/0x00phantom-hat/Hoverfly-1.11.3-RCE-CVE-2025-54123-Exploit
- CVE-2025-54123 exploit and documentation (github_poc): https://github.com/tristanqtn/CVE-2025-54123
- PoC CVE-2025-54123 - Hoverfly <= 1.11.3 - Authenticated Middleware Command Injection (github_poc): https://github.com/f4dee-backup/CVE-2025-54123
- Hoverfly CVE RCE (github_poc): https://github.com/davidzzo23/CVE-2025-54123

## Other vulnerabilities in SpectoLabs hoverfly

- [CVE-2025-54376](https://insights.sbomify.com/CVE-2025-54376/): Hoverfly's WebSocket endpoint `/api/v2/ws/logs` reachable without authentication even when --auth is enabled. (high 7.8)
- [CVE-2024-45388](https://insights.sbomify.com/CVE-2024-45388/): Arbitrary file read in the `/api/v2/simulation` endpoint in hoverfly (`GHSL-2023-274`) (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-54123 and fix it if it is affected.

What it is: CVE-2025-54123 is a critical command injection vulnerability in SpectoLabs hoverfly, published on 10 Sep 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-54123 exists.

Affected packages and fixed versions:
- github.com/SpectoLabs/hoverfly (Go): affected all versions; no fix listed
- github.com/SpectoLabs/hoverfly (Go): affected all versions up to 1.11.3; no fix listed
- github.com/SpectoLabs/hoverfly (Go): affected all versions up to 1.11.3; no fix listed

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-54123/ (Markdown: https://insights.sbomify.com/CVE-2025-54123/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-54123
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-54123
- OSV: https://osv.dev/vulnerability/CVE-2025-54123

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-54123/
Summaries are generated and may contain mistakes; the official description above is the record.
