Skip to main content
← All vulnerabilities
CVE-2026-87865

knownhost callback mismatches key as missing

Only libcurl built with the libssh2 backend, using SFTP or SCP with a hashed known_hosts file, is affected in versions 7.69.1 through 8.22.0. curl rates it Low. Fixed in 8.23.0.

Published
Last modified
published
Not listed in CISA KEV
Specific setups only
Low (curl)
Fix
Fixed in 8.14.3, 8.16.2, 8.20.2, 8.23.0
None on Exploit-DB, Metasploit or GitHub
  • Exploitation: poc
  • Automatable: no
  • Technical impact: total

Summary

When libcurl uses libssh2 with a hashed `known_hosts` file, an unrelated initial entry can cause host key validation to report a key mismatch as a missing key to the `CURLOPT_SSH_KEYFUNCTION` callback.

Timeline

  1. CVE published
  2. CISA SSVC assessment

    Exploitation: poc · Automatable: no · Technical impact: total

  3. Record last updated

Affected versions

  • curl curl

    From 8.22.0 · through 8.22.0; From 8.21.0 · through 8.21.0; From 8.20.0 · through 8.20.0; From 8.19.0 · through 8.19.0; From 8.18.0 · through 8.18.0; From 8.17.0 · through 8.17.0; From 8.16.0 · through 8.16.0; From 8.15.0 · through 8.15.0; From 8.14.1 · through 8.14.1; From 8.14.0 · through 8.14.0; From 8.13.0 · through 8.13.0; From 8.12.1 · through 8.12.1; From 8.12.0 · through 8.12.0; From 8.11.1 · through 8.11.1; From 8.11.0 · through 8.11.0; From 8.10.1 · through 8.10.1; From 8.10.0 · through 8.10.0; From 8.9.1 · through 8.9.1; From 8.9.0 · through 8.9.0; From 8.8.0 · through 8.8.0; From 8.7.1 · through 8.7.1; From 8.7.0 · through 8.7.0; From 8.6.0 · through 8.6.0; From 8.5.0 · through 8.5.0; From 8.4.0 · through 8.4.0; From 8.3.0 · through 8.3.0; From 8.2.1 · through 8.2.1; From 8.2.0 · through 8.2.0; From 8.1.2 · through 8.1.2; From 8.1.1 · through 8.1.1; From 8.1.0 · through 8.1.0; From 8.0.1 · through 8.0.1; From 8.0.0 · through 8.0.0; From 7.88.1 · through 7.88.1; From 7.88.0 · through 7.88.0; From 7.87.0 · through 7.87.0; From 7.86.0 · through 7.86.0; From 7.85.0 · through 7.85.0; From 7.84.0 · through 7.84.0; From 7.83.1 · through 7.83.1; From 7.83.0 · through 7.83.0; From 7.82.0 · through 7.82.0; From 7.81.0 · through 7.81.0; From 7.80.0 · through 7.80.0; From 7.79.1 · through 7.79.1; From 7.79.0 · through 7.79.0; From 7.78.0 · through 7.78.0; From 7.77.0 · through 7.77.0; From 7.76.1 · through 7.76.1; From 7.76.0 · through 7.76.0; From 7.75.0 · through 7.75.0; From 7.74.0 · through 7.74.0; From 7.73.0 · through 7.73.0; From 7.72.0 · through 7.72.0; From 7.71.1 · through 7.71.1; From 7.71.0 · through 7.71.0; From 7.70.0 · through 7.70.0; From 7.69.1 · through 7.69.1

References 3

curl.se

hackerone.com

FAQ

Questions about CVE-2026-87865

What does this mean?

When a host is already pinned in a hashed known_hosts file, a trust-on-first-use known-host callback can fail to match its key and treat the host as new. libcurl then authenticates to the endpoint, which may be hostile if an attacker controls or intercepts the SSH server.Source: curl.se, curl.se

Am I affected, and how do I check?

The affected range is curl 7.69.1 through 8.22.0. To check, run curl --version and look for libssh2 in the feature list, then review whether the transfers use SFTP or SCP, whether known_hosts is hashed, and whether CURLOPT_SSH_KEYFUNCTION is set.Source: curl.se, curl.se

What should I do about it?

Upgrade to curl 8.23.0, or to the backported fixed releases 8.14.3, 8.16.2, or 8.20.2 if you stay on those branches. Until then, avoid the libssh2 backend for SFTP and SCP transfers.Source: curl.se, curl.se

Is it being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. CISA's SSVC assessment notes a proof of concept exists. No public exploit code is tracked.Source: cve.now feed data

Why is it rated 7.4 High?

CVSS scores the worst case at 7.4 (high), while curl rates it Low because the bug needs a specific setup: the libssh2 backend, SFTP or SCP, a hashed known_hosts file, and a trust-on-first-use callback. curl's advisory calls this combination uncommon.Source: curl.se, curl.se