CVE-2023-28531
Critical · 9.8CVSS
9.8
EPSS
3.0%
Published
Mar 17, 2023
CISA due date
—
Cloudanix analysis
A problem in how SSH handles certain smartcard keys lets them work on more computers than they should, raising the chance that someone could reach systems they are not supposed to access.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Lateral Movement
- Component
- Application
- Class
- Authorization Bypass
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
ssh-add in OpenSSH bypasses per-hop destination constraints when adding smartcard keys to ssh-agent, allowing keys to authenticate to hosts beyond their intended scope.
Why it matters to the business
Organizations relying on constrained smartcard SSH keys face expanded unauthorized access risk, enabling potential lateral movement across systems and increased exposure of sensitive resources.
How an attack unfolds
An attacker with local access or influence over the ssh-add process supplies a smartcard key that should be destination-constrained; the vulnerable ssh-add omits the constraints when loading it into ssh-agent, after which the attacker uses the now-unrestricted agent for SSH authentication to additional hosts.
How to fix it
Upgrade OpenSSH to version 9.3 or later on all affected systems including OpenBSD OpenSSH and NetApp products; apply any vendor-specific patches for Brocade Fabric OS, HCI Bootstrap OS, and SolidFire Element OS once released.
How to confirm the fix worked
Confirm OpenSSH version reports 9.3 or newer; test ssh-add operations with constrained smartcard keys and verify destination restrictions are enforced in the resulting ssh-agent state.
Typical attack path
- Locate systems running OpenSSH versions 8.9 through 9.2
- Gain ability to invoke ssh-add with a smartcard key
- Trigger key addition that omits intended destination constraints
- Leverage the loaded key via ssh-agent to reach previously restricted hosts
- Perform unauthorized actions or move laterally
How to detect it
Examine ssh-agent debug or verbose logs around key addition events for missing destination constraint strings; correlate SSH authentication records showing access from agents that should have been limited; review system logs for ssh-add invocations on versions prior to 9.3.
What your security team should do
- Prioritize upgrade of all OpenSSH instances to 9.3 or later
- Audit current ssh-agent contents for any unconstrained smartcard keys
- Review and tighten SSH key management policies for smartcard use
- Monitor SSH authentication logs for unexpected host access patterns
The record
ssh-add in OpenSSH before 9.3 adds smartcard keys to ssh-agent without the intended per-hop destination constraints. The earliest affected version is 8.9.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Alpine:v3.16 | openssh | 0 | 9.0_p1-r3 |
| Alpine:v3.17 | openssh | 0 | 9.1_p1-r3 |
| Debian:12 | openssh | 0 | 1:9.2p1-2+deb12u2 |
| Debian:13 | openssh | 0 | 1:9.3p1-1 |
| Debian:14 | openssh | 0 | 1:9.3p1-1 |
| Ubuntu:20.04:LTS | openssh | 0 | 1:8.2p1-4ubuntu0.10 |
| Ubuntu:22.04:LTS | openssh | 0 | 1:8.9p1-3ubuntu0.5 |
| Ubuntu:23.10 | openssh | 0 | 1:9.3p1-1ubuntu3.1 |
Related vulnerabilities
- 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-2023-51384 In ssh-agent in OpenSSH before 9.6, certain destination constraints can be incompletely… Also affects openssh
- CVE-2023-48795 The SSH transport protocol with certain OpenSSH extensions, found in OpenSSH before 9.6… 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-10009 Untrusted search path vulnerability in ssh-agent.c in ssh-agent in OpenSSH before 7.4… Also affects openssh
- CVE-2024-6387 A security regression (CVE-2006-5051) was discovered in OpenSSH's server (sshd). Also affects openssh
- CVE-2023-25136 OpenSSH server (sshd) 9.1 introduced a double-free vulnerability during… Also affects openssh
- CVE-2016-10708 sshd in OpenSSH before 7.4 allows remote attackers to cause a denial of service (NULL… Also affects openssh