HexBrain

curl · Report #3480925

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

Validstatus
lowseverity
13upvotes
7 Jan 2026disclosed

How it was found

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.

This report was disclosed publicly on HackerOne and belongs to its author and the program. See the original