CVE-2025-26465
openssh: Machine-in-the-middle attack if VerifyHostKeyDNS is enabled
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · February 17, 2025
Updated · October 22, 2026
Description
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.
Statement
This issue is rated as a moderate severity vulnerability instead of important because it requires specific conditions to be exploitable.
First, the OpenSSH client must have the VerifyHostKeyDNS option enabled, which is disabled by default in Red Hat Enterprise Linux.
Second, the attacker must be able to exhaust SSH client memory and trigger out-of-memory condition.
Additionally, while the attack allows a machine-in-the-middle (MITM) adversary to trick the client into accepting an incorrect host key, it does not directly lead to code execution or immediate system compromise. Instead, the attack requires additional steps, such as credential interception or session hijacking to fully exploit the breach.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
This issue can be mitigated by disabling VerifyHostKeyDNS by setting that option to 'no' in an SSH client configuration file (such as /etc/ssh/ssh_config, ~/.ssh/config, or one of the files in the /etc/ssh/ssh_config.d/ directory). This is the default configuration in Red Hat Enterprise Linux.
For configurations that require VerifyHostKeyDNS to be enabled (set to either 'yes' or 'ask'), mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.
CVSS / CWE
CVSS 3.1 · 6.8CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N
CWE-390 · Detection of Error Condition Without Action