OpenSSH 10.5 Patches Critical ssh-agent Flaw Exposing Local Keys
OpenSSH 10.5 resolves a vulnerability where locking the ssh-agent inadvertently disabled origin checks, potentially exposing local keys via forwarded connections.

A critical security flaw in OpenSSH version 10.4 has been addressed with the release of OpenSSH 10.5. The vulnerability, discovered in the ssh-agent component, allowed forwarded connections to bypass origin verification checks when the agent was locked. This meant that operations intended to be restricted to the local machine could be executed remotely, posing a significant risk to users who relied on the locking mechanism for security.
The ssh-agent is designed to securely store decrypted private keys, eliminating the need for users to repeatedly enter passphrases. Agent forwarding, a feature that allows programs on a remote server to use these keys for authentication, relies on specific requests to differentiate between local and forwarded connections. In OpenSSH 10.4, when an agent was locked, it failed to properly distinguish between these requests. Consequently, a locked agent would incorrectly treat requests arriving through a forwarded connection as local, thereby granting unauthorized access to sensitive operations.
This misclassification had serious implications. Operations that should have been confined to the user's local machine, such as adding PKCS#11 tokens or utilizing keys with destination restrictions (limiting a key's use to a specific host), could be performed by remote attackers. This effectively undermined the security posture intended by locking the agent, turning a protective measure into a potential vector for compromise. An attacker gaining access to a forwarded session could exploit this flaw to perform actions that the user believed were protected by the locked agent.
OpenSSH 10.5 rectifies this by restoring the proper origin verification for locked ssh-agents. This ensures that requests originating from forwarded connections are correctly identified and handled according to their source, preventing unauthorized access to local keys and operations. The update is crucial for all users employing agent forwarding or relying on the locking mechanism for enhanced security.
Beyond the primary ssh-agent vulnerability, OpenSSH 10.5 also addresses two other security issues. One involves a potential use-after-free vulnerability in the ssh client related to reallocations when remote forwarding is configured through the local session multiplexing socket. The other fix corrects an issue where the restrict keyword in authorized_keys was not fully effective against tunnel forwarding, although this required administrative configuration to enable tunnels in the first place.
The OpenSSH development team noted an increase in security bug reports, many of which are attributed to AI models. While acknowledging the value of these findings, the team emphasized the need for human triage and analysis. The accelerated release schedule for fixes, including this latest update, is a response to concerns that vulnerabilities identified by AI could also be discovered and exploited by adversaries, necessitating prompt patching.
Other enhancements in OpenSSH 10.5 include improvements to sshd's public key type comparison before parsing, reducing the attack surface for unauthenticated clients. The release also fixes double-free issues in ssh-keygen and refines the preference for FIDO keys during public key authentication, prioritizing those that require no user touch.
This update underscores the ongoing importance of keeping critical infrastructure software like OpenSSH up-to-date. The swift patching of such fundamental components is vital for maintaining the security and integrity of remote access and authentication mechanisms across the internet.