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

Critical 9.8 Published Updated

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

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

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, CWE-20

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.

PackageAffectedFixed in
github.com/SpectoLabs/hoverfly GoAll versionsNone
github.com/SpectoLabs/hoverfly GoAll versions to 1.11.3None
github.com/SpectoLabs/hoverfly GoAll versions to 1.11.3None

Products include Hoverfly Hoverfly.

How do I fix CVE-2025-54123?

Upgrade to a fixed version.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

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: 1 Nuclei template and 6 proofs of concept on GitHub.

Sources

Also known as GHSA-r4h8-hfp2-ggmf, GO-2025-3944.

Is CVE-2025-54123 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free