OpenBSD OpenSSH host-key verification logic error enables machine-in-the-middle impersonation

Note: This data is for reference and cybersecurity research purposes only.CyStack advises users not to use this information for unlawful purposes.

What is CVE-2025-26465?

CVE-2025-26465 is a vulnerability classified as Detection of Error Condition Without Action, affecting OpenSSH (affected versions: 6.8p1 – ≤ 9.9p1), Red Hat Enterprise Linux 8, Red Hat Enterprise Linux 9, and 3 more products. This vulnerability is rated Medium, with a CVSS score of 6.8. Public exploit code or evidence is available for this vulnerability, but that does not confirm exploitation in the wild.

Overview

Original source data

A vulnerability was found in OpenSSH when the VerifyHostKeyDNS option is enabled. A machine-in-the-middle attack can be performed by a malicious machine impersonating a legit server. This issue occurs due to how OpenSSH mishandles error codes in specific conditions when verifying the host key. For an attack to be considered successful, the attacker needs to manage to exhaust the client's memory resource first, turning the attack complexity high.

Affected products and scope

  • OpenSSH upstream: versions 6.8p1 through 9.9p1, inclusive, are identified as affected. The upstream release that fixes the issue is 9.9p2.
  • Red Hat Enterprise Linux 8: listed as affected in the normalized record. RHSA-2025:16823 addressed the issue and lists openssh-8.0p1-26.el8_10.
  • Red Hat Enterprise Linux 9.4 Extended Update Support: listed as affected. RHSA-2025:3837 addressed the issue and lists openssh-8.7p1-38.el9_4.5.
  • Red Hat Enterprise Linux 9: listed as affected. RHSA-2025:6993 addressed the issue and lists openssh-8.7p1-45.el9.
  • Red Hat Discovery 1.14 and Red Hat OpenShift Container Platform 4: listed as affected in the normalized record. The reviewed evidence does not establish an exact fixed version for either product; product-specific update status must be checked separately.

Technical details

OpenBSD OpenSSH contains a logic error in client-side host-key verification. The affected component is the verify_host_key_callback path, where the result from verify_host_key is checked incorrectly: the vulnerable code treats only -1 as failure, while the corrective patch changes the condition to reject every value other than 0. As a result, some other nonzero error codes can be interpreted as success, weakening or bypassing verification of the server's identity. The attacker-controlled input is the server response and host key presented during an SSH connection that an on-path attacker can intercept or alter. Exploitation requires the client to use VerifyHostKeyDNS with the value yes or ask; this option is disabled by default in OpenSSH. Qualys reports that the attack does not depend on whether the impersonated server has an SSHFP record in DNS. The reviewed public evidence does not fully establish the precise wire-level sequence needed to produce each relevant error result, so additional payloads or indicators should not be inferred.

Exploitability

The flaw is remotely reachable by an active machine-in-the-middle attacker who can operate on the network path between an OpenSSH client and the legitimate server. The reviewed evidence does not require the attacker to authenticate to the client. The client must connect while VerifyHostKeyDNS is set to yes or ask; Qualys reports that the attack does not require the user to approve an additional prompt, although a normal SSH connection still has to be initiated. Public technical material states that Qualys discovered and demonstrated exploitability, but the supplied record does not establish widespread in-the-wild exploitation. The memory-exhaustion condition in the normalized description is not confirmed for this issue by the detailed technical advisory and is not treated here as an exploitation prerequisite.

Technical impact

The flaw can cause OpenSSH client code to treat an unsuccessful host-key verification result as successful. If an on-path attacker impersonates the server, the client may connect to the attacker's endpoint instead of the intended server. Possible consequences include disclosure or modification of SSH session data and manipulation of administrative activity conducted through that session. The issue is in the client and is not described as a service-availability failure; practical impact depends on whether VerifyHostKeyDNS is enabled, whether the connection crosses a path controlled by the attacker and what data or privileges are used in the session.

Business impact

An SSH administrative session intercepted by a machine-in-the-middle attacker may terminate at an impersonating server instead of the intended server. In that situation, data exchanged through the session or administrative actions performed through it could potentially be disclosed or altered, depending on how the session is used. The risk is especially relevant to bastion hosts, privileged administration, automation and SSH connections crossing untrusted networks. VerifyHostKeyDNS is disabled by default in OpenSSH, but that default does not protect systems where the option has been enabled through local configuration or platform policy.

Remediation

  1. Upgrade upstream OpenSSH to 9.9p2 or apply the operating-system vendor's fix for the relevant deployment branch. Do not infer the status of parallel branches from the fact that one branch has a fix.
  2. On Red Hat Enterprise Linux, apply the advisory for the installed branch and verify the installed package. The Red Hat updates reviewed list openssh-8.0p1-26.el8_10 for Red Hat Enterprise Linux 8, openssh-8.7p1-38.el9_4.5 for Red Hat Enterprise Linux 9.4 Extended Update Support and openssh-8.7p1-45.el9 for Red Hat Enterprise Linux 9.
  3. On OpenBSD 7.6, apply errata 008 and rebuild and install OpenSSH using the errata procedure.
  4. If immediate updating is not possible, keep VerifyHostKeyDNS disabled and review included configuration files. This is a temporary exposure-reduction measure, not a substitute for patching, because the effective setting must be verified on each client.
  5. For Red Hat Discovery 1.14 and Red Hat OpenShift Container Platform 4, check the product-specific update channel before declaring remediation complete. The reviewed evidence does not confirm an exact fixed version for these products.

Detection

  1. Inventory all OpenSSH client installations, including administrator workstations, bastion hosts, automation systems, images and containers that contain ssh(1).
  2. Inspect the effective configuration, including included files, to determine whether VerifyHostKeyDNS is set to yes or ask. Do not rely only on the default value, because local configuration or platform policy may change it.
  3. Compare the upstream OpenSSH version or operating-system package version with the affected and fixed boundaries listed in affected_summary.
  4. On OpenBSD 7.6, verify that errata 008 has been applied and that the OpenSSH client was rebuilt and installed according to the errata procedure.
  5. On Red Hat Enterprise Linux, verify that the installed openssh package matches the advisory for the exact operating-system branch.
  6. The reviewed evidence does not establish a CVE-specific log event or IOC. Absence of unusual log evidence does not prove safety; general monitoring of SSH connections across untrusted network paths is only a precautionary control.
Sources (46)
Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.