Description
When a libcurl-based application performs transfers via `SCP://` or `SFTP://`
and utilizes the `CURLOPT_SSH_KEYFUNCTION` callback, it may silently accept an
untrusted server. This vulnerability occurs when a server presents a host key
type that does not match the specific key type already recorded for that host
in the `known_hosts` file. Instead of rejecting the mismatch, the callback
mechanism fails to properly enforce the restriction, allowing the connection
to succeed without warning and risking a potential man-in-the-middle attack.
Published: 2026-07-03
Score: 7.4 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

When a libcurl-based application performs transfers via `SCP://` or `SFTP://` and utilizes the `CURLOPT_SSH_KEYFUNCTION` callback, it may silently accept an untrusted server. This vulnerability occurs when a server presents a host key type that does not match the specific key type already recorded for that host in the `known_hosts` file. Instead of rejecting the mismatch, the callback mechanism fails to properly enforce the restriction, allowing the connection to succeed without warning and risking a potential man‑in‑the‑middle attack.

Affected Systems

Any application shipping libcurl that enables SCP or SFTP transfers and employs the `CURLOPT_SSH_KEYFUNCTION` callback is susceptible. The issue affects all libcurl versions up to the latest release that still contains the incomplete enforcement logic. Systems running such applications—including command‑line tools, scripts, or integrated services that rely on libcurl for SSH based file operations—must verify that a fix has been applied.

Risk and Exploitability

The CVSS score of 7.4 indicates high severity. With an EPSS score below 1 %, exploitation attempts are expected to be rare but not impossible. Because the vulnerability is not listed in CISA KEV, there is currently no publicly known active exploitation. The attack vector requires the attacker to control or impersonate a server that presents a mismatched host key type. If the application accepts the connection without warning, the attacker can intercept traffic, potentially capturing credentials or data. The mitigation is to apply a patched libcurl or disable the insecure callback usage.

Generated by OpenCVE AI on July 21, 2026 at 10:10 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Update libcurl to a version that enforces host key type validation before invoking the callback.
  • Remove or modify the use of `CURLOPT_SSH_KEYFUNCTION` in the application; replace it with a custom callback that verifies the host key type against the known_hosts entry.
  • Manually verify the server's host key type against the known_hosts entry before proceeding with the transfer, or disable insecure host key validation globally if a patch cannot be applied.

Generated by OpenCVE AI on July 21, 2026 at 10:10 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Ubuntu USN Ubuntu USN USN-8487-1 curl vulnerabilities
History

Tue, 07 Jul 2026 00:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-347
References
Metrics threat_severity

None

threat_severity

Important


Mon, 06 Jul 2026 22:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-295
CWE-307

Mon, 06 Jul 2026 18:30:00 +0000

Type Values Removed Values Added
Metrics cvssV3_1

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

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Mon, 06 Jul 2026 04:45:00 +0000

Type Values Removed Values Added
Weaknesses CWE-295
CWE-307

Sun, 05 Jul 2026 20:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-295

Sun, 05 Jul 2026 09:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-295

Sun, 05 Jul 2026 01:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-295

Sat, 04 Jul 2026 09:45:00 +0000

Type Values Removed Values Added
Weaknesses CWE-295

Fri, 03 Jul 2026 21:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-287

Fri, 03 Jul 2026 10:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-287

Fri, 03 Jul 2026 08:30:00 +0000

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

Fri, 03 Jul 2026 06:45:00 +0000

Type Values Removed Values Added
Description When a libcurl-based application performs transfers via `SCP://` or `SFTP://` and utilizes the `CURLOPT_SSH_KEYFUNCTION` callback, it may silently accept an untrusted server. This vulnerability occurs when a server presents a host key type that does not match the specific key type already recorded for that host in the `known_hosts` file. Instead of rejecting the mismatch, the callback mechanism fails to properly enforce the restriction, allowing the connection to succeed without warning and risking a potential man-in-the-middle attack.
Title SSH improper host validation
References

cve-icon MITRE

Status: PUBLISHED

Assigner: curl

Published:

Updated: 2026-07-06T16:48:14.469Z

Reserved: 2026-05-26T06:45:27.665Z

Link: CVE-2026-9547

cve-icon Vulnrichment

Updated: 2026-07-06T16:48:09.620Z

cve-icon NVD

No data.

cve-icon Redhat

Severity : Important

Publid Date: 2026-07-03T06:18:44Z

Links: CVE-2026-9547 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-07-21T10:15:02Z

Weaknesses
  • CWE-347

    Improper Verification of Cryptographic Signature