CVE Deep Dive : CVE-2025–26465
OpenSSH's DNS-based host key verification (VerifyHostKeyDNS) mishandles error codes when memory exhaustion occurs, causing the client to accept an attacker's host key as valid. An active machine-in-the-middle attacker can then impersonate legitimate servers and intercept SSH sessions.
medium.com
Published on medium.com
The vulnerability stems from improper error handling in OpenSSH’s DNS verification code introduced in December 2014. When verifying host keys via DNS SSHFP records, OpenSSH fails to properly distinguish between different error conditions.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely improper error handling in OpenSSH's DNS verification code: memory exhaustion causes verification functions to return error codes that are misinterpreted as successful validation.
Impact
An attacker in a MitM position could intercept and modify all SSH traffic, leading to credential theft and session manipulation, but only when VerifyHostKeyDNS is enabled and the attacker can exhaust client memory.
What the attacker needed
VerifyHostKeyDNS set to yes or ask; Active MitM network position; Ability to exhaust client memory
The fix
The vulnerability was fixed in OpenSSH 9.9p2 by ensuring memory exhaustion causes connection failure rather than accepting unverified keys.
How it was found
- Attacker intercepts SSH connection attempt via network MitM position
- Attacker triggers memory exhaustion on client through various techniques
- During DNS verification failure due to memory exhaustion, client mishandles error codes
- OpenSSH incorrectly accepts attacker’s host key as valid
- All SSH traffic flows through attacker’s server, enabling credential theft and session manipulation
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When you connect to a server over SSH, your computer checks the server's identity using a key. OpenSSH can also check a special DNS record to confirm that key. This report says that if an attacker can make your computer run out of memory at the right moment, OpenSSH gets confused and accepts a fake key, letting the attacker sit in the middle of your connection.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.