Skip to content
Access control Disclosed report Intermediate CVE-2025-15224

CVE-2025-15224: libssh key passphrase bypass without agent set

The libcurl libssh backend treated the public-key authentication option as if agent authentication were also enabled, so it would consult a running ssh-agent even when the application had not asked for that. An attacker with access to a machine where an agent holds the user's key could authenticate to a remote host without knowing the key passphrase.

nyymi Follow

Originally disclosed on HackerOne

  • Triaged in 1 hour
  • Fixed in 9 days
  • Disclosed after 9 days

Summary:

libcurl libssh backend CURLOPT_SSH_AUTH_TYPES doesn't implement CURLSSH_AUTH_AGENT flag correctly. Rather if CURLSSH_AUTH_PUBLICKEY is set, the implementation acts as if CURLSSH_AUTH_AGENT is always implicitly defined, and thus no key passphrase is required for authentication.

As a result if the user has ssh-agent /pageant running, libcurl using application that specifically does not set CURLSSH_AUTH_AGENT will still use the ssh-agent / pageant for authentication bypassing the requirement for knowing the key passphrase.

Affected version

8.17.0

Steps To Reproduce:

  1. Configure and build libcurl with --with-libssh
  2. Compile the following proof-of-concept app:
#include <curl/curl.h>
int main(void)
{
  CURL *curl = curl_easy_init();
  if(curl) {
    curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
    curl_easy_setopt(curl, CURLOPT_URL, "sftp://host.example/");
    curl_easy_setopt(curl, CURLOPT_SSH_AUTH_TYPES, CURLSSH_AUTH_PUBLICKEY);
    curl_easy_perform(curl);
    curl_easy_cleanup(curl);
  }
  return 0;
}
  1. Have the current user have account on host.example. Have a passphrase set for the user's ssh key. Have the ssh key pubkey added to the host.example users ~/.ssh/authorized_keys. Have ssh-agent running with the user's key added.
  2. Execute the proof of concept application.

As a result the application authenticates to the host.example without needing the ssh key passphrase.

Supporting Material/References:

Impact

Summary:

Bypassing the SSH key passphrase requirement.

The original report as published on HackerOne, by nyymi. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

Root cause

Likely the libssh backend maps the public-key auth flag onto libssh's automatic public-key call, which itself falls back to the agent, so the agent flag is effectively always on.

Impact

An application that deliberately excluded agent authentication could still authenticate through a running agent, bypassing the key passphrase requirement.

What the attacker needed

Libcurl built with libssh; passphrase-protected SSH key; ssh-agent running with the key loaded; account on the target host

How it was found

  1. Build libcurl with the libssh backend enabled.
  2. Compile a small program that sets the SSH auth types option to public key only and connects to an SFTP URL.
  3. Ensure the user has an account on the host, a passphrase-protected key whose public part is authorised there, and an agent holding that key.
  4. Run the program and observe it authenticates without the passphrase.

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.

SSH keys can be protected by a passphrase, a password that unlocks the key. Many people load their key into a helper program called an agent so they do not retype the passphrase. Here a library asked to use only the key file still quietly asked the agent, so the passphrase check was skipped.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by nyymi

View all

51 more disclosed reports, best first.

More from curl

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.