---
id: "CVE-2026-87865"
kind: "vulnerability"
aliases: ["CVE-2026-87865"]
title: "libcurl: hashed known_hosts can misreport host key mismatch as missing"
severity: "unknown"
cvss: null
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["libcurl", "libssh2", "package", "scp", "sftp", "ssh"]
not_affected_if: ["libssh-backend", "no-keyfunc-callback", "no-ssh-transfers"]
published_at: "2026-10-20T21:17:20+00:00"
first_seen_at: "2026-10-23T21:57:21+00:00"
updated_at: "2026-10-25T05:04:28+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-87865", "first_seen_at": "2026-10-23T21:57:21+00:00"}]
---

# libcurl: hashed known_hosts can misreport host key mismatch as missing

When libcurl uses libssh2 with a hashed known_hosts file, an unrelated initial entry can make host key validation report a key mismatch as a missing key to the CURLOPT_SSH_KEYFUNCTION callback. An attacker positioned to present a changed host key could be accepted by a callback that treats missing keys as new hosts.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Run `curl --version` and look for libssh2 in the features line.
- Check whether the application sets CURLOPT_SSH_KEYFUNCTION and uses a hashed known_hosts file.

## Fix

- Upgrade libcurl to a fixed release: unknown
- Until patched, use strict host key checking with known fingerprints: unknown

## Timeline

- 2026-10-23T21:57:21+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-87865

## From the sources

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.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
