Description
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.
Published: 2026-10-20
Score: 3.7 Low
EPSS: n/a
KEV: No
Impact: Unauthorized Authentication via Host Key Misverification
Action: Apply Patch
AI Analysis

Impact

A flaw in libcurl built with the libssh2 backend and a hashed known-hosts file causes host key verification to incorrectly report a key mismatch as a missing key to custom verification callbacks. This misreporting allows a remote attacker controlling or intercepting the SSH session to make an already pinned server appear as a new host, potentially leading the application to authenticate to an untrusted server and exposing credentials and malicious data.

Affected Systems

All installations of libcurl that are configured with the libssh2 backend and use a hashed known-hosts file are affected. No specific version numbers are provided, so any build with this configuration is susceptible.

Risk and Exploitability

The CVSS score of 3.7 indicates moderate severity, and the EPSS score is not available, suggesting a low exploitation probability at this time. The vulnerability is not listed in CISA KEV. The likely attack vector is a remote attacker who controls or intercepts the SSH traffic; exploitation requires manipulating the SSH session to present a forged host key, after which the application may authenticate to a malicious server, leading to credential exposure and potential data compromise.

Generated by OpenCVE AI on October 17, 2026 at 02:09 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade libcurl to a version that contains the fix for the libssh2 backend and hashed known-hosts handling.
  • If an upgrade is not possible, disable the libssh2 backend or avoid using a hashed known-hosts file for critical connections.
  • Configure SSH or libcurl to enforce strict host key checking and log any key mismatches for review.

Generated by OpenCVE AI on October 17, 2026 at 02:09 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Ubuntu USN Ubuntu USN USN-8927-1 curl vulnerabilities
Ubuntu USN Ubuntu USN USN-8927-2 curl vulnerabilities
History

Tue, 20 Oct 2026 20:30:00 +0000

Type Values Removed Values Added
Description A flaw was found in curl. When libcurl is built with the libssh2 backend and uses a hashed known-hosts file, host key verification can mistakenly report a key mismatch as a missing key to custom verification callbacks. A remote attacker who intercepts or controls the Secure Shell (SSH) connection can exploit this flaw to make a previously pinned server appear as a new host. As a result, the application may inadvertently authenticate to an untrusted server, leading to credential exposure and the receipt of malicious data. 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.
Title curl: curl: knownhost callback mismatches key as missing knownhost callback mismatches key as missing
References

Sun, 18 Oct 2026 15:00:00 +0000

Type Values Removed Values Added
First Time appeared Curl
Curl curl
Vendors & Products Curl
Curl curl

Sat, 17 Oct 2026 00:30:00 +0000

Type Values Removed Values Added
Description A flaw was found in curl. When libcurl is built with the libssh2 backend and uses a hashed known-hosts file, host key verification can mistakenly report a key mismatch as a missing key to custom verification callbacks. A remote attacker who intercepts or controls the Secure Shell (SSH) connection can exploit this flaw to make a previously pinned server appear as a new host. As a result, the application may inadvertently authenticate to an untrusted server, leading to credential exposure and the receipt of malicious data.
Title curl: curl: knownhost callback mismatches key as missing
Weaknesses CWE-295
References
Metrics threat_severity

None

cvssV3_1

{'score': 3.7, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N'}

threat_severity

Low


cve-icon MITRE

Status: PUBLISHED

Assigner: curl

Published:

Updated: 2026-10-20T20:15:13.165Z

Reserved: 2026-09-09T13:17:41.347Z

Link: CVE-2026-87865

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-10-20T21:17:20.693

Modified: 2026-10-20T21:17:20.693

Link: CVE-2026-87865

cve-icon Redhat

Severity : Low

Publid Date: 2026-10-14T12:00:00Z

Links: CVE-2026-87865 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-18T14:45:06Z

Weaknesses
  • CWE-295

    Improper Certificate Validation