CVE-2021-36368
Low · 3.7CVSS
3.7
EPSS
1.7%
Published
Mar 13, 2022
CISA due date
—
Cloudanix analysis
Users of hardware security keys for remote logins may receive an unclear prompt that could let a compromised server forward their login privileges to another machine without them realizing it.
- Exploitation
- Other
- Attacker needs
- High Privilege
- Complexity
- High
- Impact
- Other
- Component
- Network Service
- Class
- Authentication Bypass
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
In OpenSSH before 8.9, when using public-key authentication with agent forwarding and FIDO tokens without verbose logging, a server modified to advertise the None authentication method can cause the client to display an ambiguous confirmation prompt that does not distinguish between direct server connection and agent forwarding to a third party.
Why it matters to the business
Organizations using hardware-backed SSH keys with agent forwarding face a small risk that users may inadvertently approve forwarding to an attacker-controlled host, potentially allowing lateral movement through the user's agent without clear user awareness.
How an attack unfolds
An attacker first deploys a malicious SSH server that advertises support for the None authentication method. When a victim client connects using public-key authentication with agent forwarding and a FIDO token (without -oLogLevel=verbose), the ambiguous confirmation prompt leads the user to approve the connection. This can result in the attacker gaining the ability to use the forwarded agent for further connections on the user's behalf.
How to fix it
Upgrade OpenSSH to version 8.9 or later, which contains the fix from commit 166456cedad3962b83b848b1e9caf80794831f0f. Enable verbose logging during connections that use agent forwarding with FIDO tokens to make the purpose of each confirmation explicit.
How to confirm the fix worked
Confirm the installed OpenSSH version is 8.9 or newer. Test connections with agent forwarding and FIDO tokens both with and without -oLogLevel=verbose to verify that confirmation prompts clearly indicate whether forwarding is being requested.
Typical attack path
- Deploy a malicious SSH server advertising the None authentication method
- Wait for a victim to initiate a public-key connection with agent forwarding and FIDO token without verbose logging
- Present the ambiguous FIDO confirmation prompt to the victim
- Obtain user approval that enables agent forwarding to the attacker's server
- Use the forwarded agent to authenticate to other hosts on the victim's behalf
How to detect it
Review SSH client logs for connections that used agent forwarding with FIDO tokens; look for repeated or unexpected forwarding confirmations. Monitor for servers advertising the None authentication method during public-key exchanges.
What your security team should do
- Prioritize upgrade of all OpenSSH installations to 8.9 or later within standard change windows
- Update internal SSH client configurations and documentation to recommend -oLogLevel=verbose when agent forwarding is used
- Review and restrict agent forwarding permissions in sshd_config where possible
The record
An issue was discovered in OpenSSH before 8.9. If a client is using public-key authentication with agent forwarding but without -oLogLevel=verbose, and an attacker has silently modified the server to support the None authentication option, then the user cannot determine whether FIDO authentication is going to confirm that the user wishes to connect to that server, or that the user wishes to allow that server to connect to a different server on the user's behalf. NOTE: the vendor's position is "this is not an authentication bypass, since nothing is being bypassed.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:10 | openssh | 0 | No fix |
| Debian:11 | openssh | 0 | No fix |
| Debian:12 | openssh | 0 | 1:8.9p1-1 |
| Debian:13 | openssh | 0 | 1:8.9p1-1 |
| Debian:14 | openssh | 0 | 1:8.9p1-1 |
Related vulnerabilities
- CVE-2023-51767 OpenSSH through 10.0, when common types of DRAM are used, might allow row hammer attacks… Also affects openssh
- CVE-2023-51385 In ssh in OpenSSH before 9.6, OS command injection might occur if a user name or host… Also affects openssh
- CVE-2021-41617 sshd in OpenSSH 6.2 through 8.x before 8.8, when certain non-default configurations are… Also affects openssh
- CVE-2016-20012 OpenSSH through 8.7 allows remote attackers, who have a suspicion that a certain… Also affects openssh
- CVE-2017-15906 The process_open function in sftp-server.c in OpenSSH before 7.6 does not properly… Also affects openssh
- CVE-2016-10011 authfile.c in sshd in OpenSSH before 7.4 does not properly consider the effects of… Also affects openssh
- CVE-2016-10012 The shared memory manager (associated with pre-authentication compression) in sshd in… Also affects openssh
- CVE-2016-10009 Untrusted search path vulnerability in ssh-agent.c in ssh-agent in OpenSSH before 7.4… Also affects openssh