CVE-2023-38408
Description
OpenSSH ssh-agent before 9.3p2 enables RCE via forwarded agent by loading arbitrary libraries from /usr/lib through PKCS#11, due to incomplete fix for CVE-2016-10009.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
OpenSSH ssh-agent before 9.3p2 enables RCE via forwarded agent by loading arbitrary libraries from /usr/lib through PKCS#11, due to incomplete fix for CVE-2016-10009.
Vulnerability
The PKCS#11 feature in ssh-agent (compiled with ENABLE_PKCS11, which is default) allows loading shared libraries through the SSH_AGENTC_ADD_SMARTCARD_KEY command. Due to an insufficiently trustworthy search path, an attacker can force the agent to load and immediately unload (dlopen()/dlclose()) any shared library from /usr/lib* on the host where the agent is running. This was an incomplete fix for CVE-2016-10009. Affected versions include OpenSSH before 9.3p2 [1][4].
Exploitation
An attacker with access to a remote server where the victim's ssh-agent is forwarded (via -A or ForwardAgent) can send a series of SSH_AGENTC_ADD_SMARTCARD_KEY requests. By carefully choosing libraries, the attacker can trigger a use-after-free: first load a library that registers a signal handler (e.g., SIGBUS), then load a second library that overwrites that handler's code, and finally load a library that causes a SIGBUS, jumping to attacker-controlled code. This technique exploits the fact that dlclose() does not always unmap libraries due to the NODELETE flag, and that many libraries have constructor/destructor side effects [3][4].
Impact
Successful exploitation achieves remote code execution on the victim's workstation where ssh-agent is running, at the privilege level of the user running the agent. The attacker can then access the user's private keys, execute arbitrary commands, and potentially pivot to other systems. The compromise is stealthy because the agent process terminates on error after the attack [4].
Mitigation
The vulnerability is fixed in OpenSSH version 9.3p2, released on July 19, 2023. Users should update their OpenSSH packages immediately. As a workaround, administrators can disable agent forwarding (ForwardAgent no) or use jump hosts (-J) instead of forwarding the agent [1][4].
AI Insight generated on May 26, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
86- OpenSSH/OpenSSHdescription
- Range: < 9.3p2
- osv-coords84 versionspkg:apk/chainguard/opensshpkg:apk/chainguard/openssh-clientpkg:apk/chainguard/openssh-docpkg:apk/chainguard/openssh-keygenpkg:apk/chainguard/openssh-keyscanpkg:apk/chainguard/openssh-keysignpkg:apk/chainguard/openssh-pam-configpkg:apk/chainguard/openssh-pam-configurationpkg:apk/chainguard/openssh-pkcs11-helperpkg:apk/chainguard/openssh-serverpkg:apk/chainguard/openssh-server-configpkg:apk/chainguard/openssh-servicepkg:apk/chainguard/openssh-sftp-serverpkg:apk/chainguard/openssh-sk-helperpkg:apk/wolfi/opensshpkg:apk/wolfi/openssh-clientpkg:apk/wolfi/openssh-docpkg:apk/wolfi/openssh-keygenpkg:apk/wolfi/openssh-keyscanpkg:apk/wolfi/openssh-keysignpkg:apk/wolfi/openssh-pam-configpkg:apk/wolfi/openssh-pam-configurationpkg:apk/wolfi/openssh-pkcs11-helperpkg:apk/wolfi/openssh-serverpkg:apk/wolfi/openssh-server-configpkg:apk/wolfi/openssh-servicepkg:apk/wolfi/openssh-sftp-serverpkg:apk/wolfi/openssh-sk-helperpkg:rpm/almalinux/opensshpkg:rpm/almalinux/openssh-askpasspkg:rpm/almalinux/openssh-cavspkg:rpm/almalinux/openssh-clientspkg:rpm/almalinux/openssh-keycatpkg:rpm/almalinux/openssh-ldappkg:rpm/almalinux/openssh-serverpkg:rpm/almalinux/pam_ssh_agent_authpkg:rpm/opensuse/openssh-askpass-gnome&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/openssh-askpass-gnome&distro=openSUSE%20Leap%2015.5pkg:rpm/opensuse/openssh&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/openssh&distro=openSUSE%20Leap%2015.5pkg:rpm/opensuse/openssh&distro=openSUSE%20Leap%20Micro%205.3pkg:rpm/opensuse/openssh&distro=openSUSE%20Tumbleweedpkg:rpm/suse/openssh-askpass-gnome&distro=SUSE%20Enterprise%20Storage%207pkg:rpm/suse/openssh-askpass-gnome&distro=SUSE%20Enterprise%20Storage%207.1pkg:rpm/suse/openssh-askpass-gnome&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP1-LTSSpkg:rpm/suse/openssh-askpass-gnome&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP2-LTSSpkg:rpm/suse/openssh-askpass-gnome&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-ESPOSpkg:rpm/suse/openssh-askpass-gnome&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-LTSSpkg:rpm/suse/openssh-askpass-gnome&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Desktop%20Applications%2015%20SP4pkg:rpm/suse/openssh-askpass-gnome&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Desktop%20Applications%2015%20SP5pkg:rpm/suse/openssh-askpass-gnome&distro=SUSE%20Linux%20Enterprise%20Real%20Time%2015%20SP3pkg:rpm/suse/openssh-askpass-gnome&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP2-BCLpkg:rpm/suse/openssh-askpass-gnome&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP5pkg:rpm/suse/openssh-askpass-gnome&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP1-LTSSpkg:rpm/suse/openssh-askpass-gnome&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP2-LTSSpkg:rpm/suse/openssh-askpass-gnome&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP3-LTSSpkg:rpm/suse/openssh-askpass-gnome&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP5pkg:rpm/suse/openssh-askpass-gnome&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP1pkg:rpm/suse/openssh-askpass-gnome&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP2pkg:rpm/suse/openssh-askpass-gnome&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP3pkg:rpm/suse/openssh&distro=SUSE%20Enterprise%20Storage%207pkg:rpm/suse/openssh&distro=SUSE%20Enterprise%20Storage%207.1pkg:rpm/suse/openssh&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP1-LTSSpkg:rpm/suse/openssh&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP2-LTSSpkg:rpm/suse/openssh&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-ESPOSpkg:rpm/suse/openssh&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-LTSSpkg:rpm/suse/openssh&distro=SUSE%20Linux%20Enterprise%20Micro%205.1pkg:rpm/suse/openssh&distro=SUSE%20Linux%20Enterprise%20Micro%205.2pkg:rpm/suse/openssh&distro=SUSE%20Linux%20Enterprise%20Micro%205.3pkg:rpm/suse/openssh&distro=SUSE%20Linux%20Enterprise%20Micro%205.4pkg:rpm/suse/openssh&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP4pkg:rpm/suse/openssh&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP5pkg:rpm/suse/openssh&distro=SUSE%20Linux%20Enterprise%20Real%20Time%2015%20SP3pkg:rpm/suse/openssh&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP2-BCLpkg:rpm/suse/openssh&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP5pkg:rpm/suse/openssh&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP1-LTSSpkg:rpm/suse/openssh&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP2-LTSSpkg:rpm/suse/openssh&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP3-LTSSpkg:rpm/suse/openssh&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP5pkg:rpm/suse/openssh&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP1pkg:rpm/suse/openssh&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP2pkg:rpm/suse/openssh&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP3pkg:rpm/suse/openssh&distro=SUSE%20Manager%20Proxy%204.2pkg:rpm/suse/openssh&distro=SUSE%20Manager%20Server%204.2
< 9.3_p2-r0+ 83 more
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 9.3_p2-r0
- (no CPE)range: < 8.7p1-30.el9_2
- (no CPE)range: < 8.7p1-30.el9_2
- (no CPE)range: < 8.0p1-19.el8_8
- (no CPE)range: < 8.7p1-30.el9_2
- (no CPE)range: < 8.7p1-30.el9_2
- (no CPE)range: < 8.0p1-19.el8_8
- (no CPE)range: < 8.7p1-30.el9_2
- (no CPE)range: < 0.10.4-5.30.el9_2
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 9.3p2-1.1
- (no CPE)range: < 8.1p1-150200.5.37.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 7.9p1-150100.6.31.1
- (no CPE)range: < 8.1p1-150200.5.37.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 7.2p2-74.63.1
- (no CPE)range: < 7.2p2-81.4.2
- (no CPE)range: < 7.9p1-150100.6.31.1
- (no CPE)range: < 8.1p1-150200.5.37.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 7.2p2-81.4.2
- (no CPE)range: < 7.9p1-150100.6.31.1
- (no CPE)range: < 8.1p1-150200.5.37.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 8.1p1-150200.5.37.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 7.9p1-150100.6.31.1
- (no CPE)range: < 8.1p1-150200.5.37.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 7.2p2-74.63.1
- (no CPE)range: < 7.2p2-81.4.2
- (no CPE)range: < 7.9p1-150100.6.31.1
- (no CPE)range: < 8.1p1-150200.5.37.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 7.2p2-81.4.2
- (no CPE)range: < 7.9p1-150100.6.31.1
- (no CPE)range: < 8.1p1-150200.5.37.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 8.4p1-150300.3.22.1
- (no CPE)range: < 8.4p1-150300.3.22.1
Patches
0No patches discovered yet.
Vulnerability mechanics
Synthesis attempt was rejected by the grounding validator. Re-run pending.
References
20- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CEBTJJINE2I3FHAUKKNQWMFGYMLSMWKQ/mitrevendor-advisory
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/RAXVQS6ZYTULFAK3TEJHRLKZALJS3AOU/mitrevendor-advisory
- security.gentoo.org/glsa/202307-01mitrevendor-advisory
- www.openwall.com/lists/oss-security/2023/07/20/1mitremailing-list
- www.openwall.com/lists/oss-security/2023/07/20/2mitremailing-list
- www.openwall.com/lists/oss-security/2023/09/22/11mitremailing-list
- www.openwall.com/lists/oss-security/2023/09/22/9mitremailing-list
- lists.debian.org/debian-lts-announce/2023/08/msg00021.htmlmitremailing-list
- packetstormsecurity.com/files/173661/OpenSSH-Forwarded-SSH-Agent-Remote-Code-Execution.htmlmitre
- blog.qualys.com/vulnerabilities-threat-research/2023/07/19/cve-2023-38408-remote-code-execution-in-opensshs-forwarded-ssh-agentmitre
- github.com/openbsd/src/commit/7bc29a9d5cd697290aa056e94ecee6253d3425f8mitre
- github.com/openbsd/src/commit/f03a4faa55c4ce0818324701dadbf91988d7351dmitre
- github.com/openbsd/src/commit/f8f5a6b003981bb824329dc987d101977beda7camitre
- news.ycombinator.com/itemmitre
- security.netapp.com/advisory/ntap-20230803-0010/mitre
- support.apple.com/kb/HT213940mitre
- www.openssh.com/security.htmlmitre
- www.openssh.com/txt/release-9.3p2mitre
- www.qualys.com/2023/07/19/cve-2023-38408/rce-openssh-forwarded-ssh-agent.txtmitre
- www.vicarius.io/vsociety/posts/exploring-opensshs-agent-forwarding-rce-cve-2023-38408mitre
News mentions
0No linked articles in our index yet.