OpenSSH Client Use-After-Free During Host Key Re-Exchange
First seen Jul 10, 2026 · Updated Jul 10, 2026 · CVSS 7.7
CVE-2026-60002 is a use-after-free vulnerability in OpenSSH clients prior to version 10.4, triggered when a malicious or compromised server changes its host key during a key re-exchange. Exploitation could lead to client-side memory corruption, potentially enabling denial of service or code execution on systems initiating SSH connections.
Technical Analysis
The vulnerability resides in the OpenSSH client's handling of host key changes during a mid-session key re-exchange (rekeying), where stale references to the previous host key structure may be freed and subsequently reused, resulting in a use-after-free condition. Exploitation requires a malicious or compromised SSH server to trigger the rekey with a differing host key, meaning attacks are feasible via man-in-the-middle positioning or attacker-controlled/compromised remote hosts that legitimate clients connect to. The CVSS score of 7.7 reflects the potential for memory corruption leading to crashes or, depending on heap layout and exploitation primitives, arbitrary code execution on the client host. Given that AI agent orchestration frameworks, CI/CD pipelines, and automated DevOps tooling frequently use SSH clients (including OpenSSH) to connect to remote build servers, container registries, or agent-managed infrastructure, a compromised or malicious remote endpoint could exploit this flaw to gain code execution on hosts running autonomous agents, potentially exposing API keys, credentials, or agent orchestration secrets stored on those systems.
Affected Systems
OpenSSH client versions prior to 10.4 on all platforms (Linux, BSD, macOS, Windows via Cygwin/WSL); systems using ssh, scp, sftp, or automated tooling (e.g., Ansible, CI/CD runners, agent orchestration scripts) that invoke the OpenSSH client to connect to remote or third-party SSH servers.
Indicators of Compromise
- N/A - vulnerability disclosure, no known IOCs at this time
- Monitor for: unexpected SSH client crashes or core dumps during rekeying
- Anomalous host key change events in SSH client logs (debug3: ssh_packet_check_rekey or similar)
Remediation Steps
- 1
Upgrade OpenSSH client
Update all OpenSSH client installations to version 10.4 or later, which contains the fix for the use-after-free condition during host key re-exchange.
- 2
Restrict outbound SSH connections
Limit which remote hosts internal systems, automation scripts, and AI agents are permitted to SSH into, particularly reducing exposure to untrusted or third-party servers.
- 3
Enable strict host key checking
Ensure StrictHostKeyChecking is enabled and known_hosts files are properly managed to reduce the risk of connecting to attacker-controlled servers presenting rotated host keys.
- 4
Audit automation and agent infrastructure
Review CI/CD pipelines, agent orchestration frameworks, and automated scripts for use of vulnerable OpenSSH client versions, especially those handling credentials or API keys for AI agent systems.
- 5
Monitor for anomalous rekey events
Deploy logging/monitoring for SSH client crash reports or unusual rekeying behavior that may indicate exploitation attempts.
CVE / Advisory IDs
Industries Most Exposed
Respond to this threat
Pro subscribers get a full AI-generated incident-response playbook for this threat — detection, containment, eradication, and recovery steps — plus an unlimited AI Threat Advisor for questions about your environment.