CVE-2025-26465

6.8 MEDIUM

📋 TL;DR

This OpenSSH vulnerability allows machine-in-the-middle attacks when VerifyHostKeyDNS is enabled. Attackers can impersonate legitimate servers by exploiting error code mishandling during host key verification. Systems using OpenSSH with VerifyHostKeyDNS enabled are affected.

💻 Affected Systems

Products:
  • OpenSSH
Versions: Versions prior to the patched release (specific version depends on distribution)
Operating Systems: Linux, Unix-like systems, BSD variants
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when VerifyHostKeyDNS option is explicitly enabled in ssh_config or command line

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Successful MITM attack leading to credential theft, data interception, and unauthorized access to SSH connections

🟠

Likely Case

Limited exploitation due to high attack complexity requiring memory exhaustion first, but potential targeted attacks against high-value targets

🟢

If Mitigated

Minimal impact with proper network segmentation, monitoring, and VerifyHostKeyDNS disabled

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: LOW

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: HIGH

Attack requires memory exhaustion first, making exploitation complex and resource-intensive for attackers

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Check distribution-specific updates (e.g., OpenSSH 9.8p1 or later for many distributions)

Vendor Advisory: https://access.redhat.com/security/cve/CVE-2025-26465

Restart Required: No

Instructions:

1. Update OpenSSH using your distribution's package manager. 2. For RHEL: 'sudo yum update openssh'. 3. For Debian/Ubuntu: 'sudo apt update && sudo apt upgrade openssh-client openssh-server'. 4. Verify the update completed successfully.

🔧 Temporary Workarounds

Disable VerifyHostKeyDNS

linux

Disables DNS-based host key verification, eliminating the vulnerability vector

echo 'VerifyHostKeyDNS no' >> /etc/ssh/ssh_config
echo 'VerifyHostKeyDNS no' >> ~/.ssh/config

🧯 If You Can't Patch

  • Disable VerifyHostKeyDNS option in all SSH configurations
  • Implement strict network controls and monitor for unusual SSH connection patterns

🔍 How to Verify

Check if Vulnerable:

Check if VerifyHostKeyDNS is enabled: grep -r 'VerifyHostKeyDNS' /etc/ssh/ ~/.ssh/

Check Version:

ssh -V

Verify Fix Applied:

Check OpenSSH version: ssh -V 2>&1 | grep -o 'OpenSSH_[0-9.]*' and compare with patched version for your distribution

📡 Detection & Monitoring

Log Indicators:

  • Multiple failed SSH connections with memory exhaustion warnings
  • Unusual SSH host key verification failures

Network Indicators:

  • Unexpected SSH connection attempts to internal systems
  • DNS queries for SSH host key verification followed by connection failures

SIEM Query:

source="ssh" AND ("VerifyHostKeyDNS" OR "memory" OR "exhaust")

🔗 References

📤 Share & Export