Skip to content
RCE Advisory Intermediate CVE-2024-45388

GHSL-2023-272_GHSL-2023-274: Command Injection and Server-Side Request Forgery (SSRF) in Hoverfly - CVE-2024-45388

The Hoverfly admin API lacks authentication by default, allowing an attacker to install middleware that executes arbitrary commands or makes requests to arbitrary hosts, and to read arbitrary files via path traversal. An attacker could achieve remote code execution, blind SSRF, and information disclosure.

Alvaro Muñoz Follow

Originally disclosed on GitHub Security Lab

Hoverfly is a lightweight service virtualization/API simulation/API mocking tool for developers and testers. The hoverfly server is vulnerable to command injection, server-side request forgery (SSRF) and arbitrary file read.

pwntester, on GitHub Security Lab

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

This issue may lead to pre-auth Remote Code Execution (RCE), blind SSRF, and information disclosure, but the admin API is not exposed on public network by default and can be secured with basic HTTP auth.

What the attacker needed

Access to the admin API; admin API not secured with basic auth

The fix

The issues were considered to work as expected because the admin API is not exposed by default and can be secured with basic HTTP auth; however, one issue (arbitrary file read) was fixed and an advisory published.

How it was found

  1. Send a PUT request to /api/v2/hoverfly/middleware with a JSON body specifying a binary and script to execute a command.
  2. Send a PUT request to /api/v2/hoverfly/middleware with a remote URL to make the server send a POST request to that URL.
  3. Send a POST request to /api/v2/simulation with a bodyFile containing ../ sequences to read an arbitrary file.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Hoverfly is a tool for simulating APIs. Its admin interface has no password by default, so anyone who can reach it can tell it to run commands, make requests to other servers, or read files on the machine. This is dangerous if the admin interface is exposed to the internet.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Alvaro Muñoz

View all

132 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.