← Vulnerability feed

Vulnerability record · CVE-2023-38408 · published 20 July 2023

CVE-2023-38408: OpenSSH ssh-agent PKCS#11 search path flaw enables RCE via agent forwarding

Openbsd · Openssh

The PKCS#11 support in ssh-agent in OpenSSH before 9.3p2 uses an insufficiently trustworthy search path, so code loaded from locations such as /usr/lib is not necessarily safe to load into the agent. Because this is an incomplete fix for CVE-2016-10009, an attacker who controls a system to which an agent is forwarded can abuse the forwarded agent to execute code on the victim's machine.

9.8 CVSS 3.1 Critical EPSS 80% · top 0.4% CWE-428 · Unquoted search path
9.8CVSS 3.1 base score
80%EPSS exploitation probability, 30 days
NoNot in CISA KEV
2Affected product versions listed by NVD
40References, 6 tagged exploit
17 Jun 2026Last modified by NVD

Description

The PKCS#11 feature in ssh-agent in OpenSSH before 9.3p2 has an insufficiently trustworthy search path, leading to remote code execution if an agent is forwarded to an attacker-controlled system. (Code in /usr/lib is not necessarily safe for loading into ssh-agent.) NOTE: this issue exists because of an incomplete fix for CVE-2016-10009.

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Automated analysis

Generated by VULONE's analysis model from the NVD record, CISA KEV and EPSS data on 18 September 2026. Confidence: high.

critical priorityCVSS 9.8 with network reachability, no privileges or interaction required, and public exploit references make this a high-impact remote code execution flaw.

What it is

The PKCS#11 support in ssh-agent in OpenSSH before 9.3p2 uses an insufficiently trustworthy search path, so code loaded from locations such as /usr/lib is not necessarily safe to load into the agent. Because this is an incomplete fix for CVE-2016-10009, an attacker who controls a system to which an agent is forwarded can abuse the forwarded agent to execute code on the victim's machine.

Impact

An attacker gains remote code execution in the context of the user running the forwarded ssh-agent, which can expose the victim's SSH keys and any host the agent can authenticate to.

Attack surface

Reached over the network through SSH agent forwarding when the victim connects to an attacker-controlled host; no authentication or user interaction beyond the forwarding connection is required per the CVSS vector AV:N/AC:L/PR:N/UI:N.

Exploitation

Not listed in CISA KEV, but EPSS is very high (0.797 probability, 99.587 percentile) and multiple references are tagged Exploit, indicating public exploit material exists.

What to do

  • Upgrade OpenSSH to 9.3p2 or later, or apply the vendor patches referenced in the advisory.
  • Disable SSH agent forwarding (ForwardAgent no) unless strictly required.
  • Restrict agent forwarding to trusted hosts and avoid forwarding to systems you do not control.
  • Where PKCS#11 is not needed, remove or disable PKCS#11 provider libraries from the agent's search path.
  • Monitor vendor advisories (OpenBSD, Fedora, Debian, Gentoo, Apple, NetApp) for backported fixes.

Detection

  • Audit ssh_config and sshd_config for ForwardAgent and AllowAgentForwarding settings across managed hosts.
  • Monitor ssh-agent processes for unexpected loading of PKCS#11 provider libraries from unusual paths.
  • Alert on outbound SSH sessions to untrusted or newly seen hosts where agent forwarding is enabled.
  • Review endpoint logs for child processes spawned by ssh-agent that are not expected.

This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.

Affected products

2 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

LinkTags
http://packetstormsecurity.com/files/173661/OpenSSH-Forwarded-SSH-Agent-Remote-Code-Execution.html ExploitThird Party AdvisoryVDB Entry
http://www.openwall.com/lists/oss-security/2023/07/20/1 ExploitMailing ListThird Party Advisory
http://www.openwall.com/lists/oss-security/2023/07/20/2 Mailing ListThird Party Advisory
http://www.openwall.com/lists/oss-security/2023/09/22/11
http://www.openwall.com/lists/oss-security/2023/09/22/9
https://blog.qualys.com/vulnerabilities-threat-research/2023/07/19/cve-2023-38408-remote-code-execution-in-opensshs-forw Third Party Advisory
https://github.com/openbsd/src/commit/7bc29a9d5cd697290aa056e94ecee6253d3425f8 Patch
https://github.com/openbsd/src/commit/f03a4faa55c4ce0818324701dadbf91988d7351d Patch
https://github.com/openbsd/src/commit/f8f5a6b003981bb824329dc987d101977beda7ca Patch
https://lists.debian.org/debian-lts-announce/2023/08/msg00021.html
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CEBTJJINE2I3FHAUKKNQWMF
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/RAXVQS6ZYTULFAK3TEJHRLK
https://news.ycombinator.com/item?id=36790196 Issue TrackingPatch
https://security.gentoo.org/glsa/202307-01 Third Party Advisory
https://security.netapp.com/advisory/ntap-20230803-0010/
https://support.apple.com/kb/HT213940
https://www.openssh.com/security.html Vendor Advisory
https://www.openssh.com/txt/release-9.3p2 Release Notes
https://www.qualys.com/2023/07/19/cve-2023-38408/rce-openssh-forwarded-ssh-agent.txt ExploitThird Party Advisory
https://www.vicarius.io/vsociety/posts/exploring-opensshs-agent-forwarding-rce-cve-2023-38408
http://packetstormsecurity.com/files/173661/OpenSSH-Forwarded-SSH-Agent-Remote-Code-Execution.html ExploitThird Party AdvisoryVDB Entry
http://www.openwall.com/lists/oss-security/2023/07/20/1 ExploitMailing ListThird Party Advisory
http://www.openwall.com/lists/oss-security/2023/07/20/2 Mailing ListThird Party Advisory
http://www.openwall.com/lists/oss-security/2023/09/22/11
http://www.openwall.com/lists/oss-security/2023/09/22/9
https://blog.qualys.com/vulnerabilities-threat-research/2023/07/19/cve-2023-38408-remote-code-execution-in-opensshs-forw Third Party Advisory
https://github.com/openbsd/src/commit/7bc29a9d5cd697290aa056e94ecee6253d3425f8 Patch
https://github.com/openbsd/src/commit/f03a4faa55c4ce0818324701dadbf91988d7351d Patch
https://github.com/openbsd/src/commit/f8f5a6b003981bb824329dc987d101977beda7ca Patch
https://lists.debian.org/debian-lts-announce/2023/08/msg00021.html
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CEBTJJINE2I3FHAUKKNQWMF
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/RAXVQS6ZYTULFAK3TEJHRLK
https://news.ycombinator.com/item?id=36790196 Issue TrackingPatch
https://security.gentoo.org/glsa/202307-01 Third Party Advisory
https://security.netapp.com/advisory/ntap-20230803-0010/
https://support.apple.com/kb/HT213940
https://www.openssh.com/security.html Vendor Advisory
https://www.openssh.com/txt/release-9.3p2 Release Notes
https://www.qualys.com/2023/07/19/cve-2023-38408/rce-openssh-forwarded-ssh-agent.txt ExploitThird Party Advisory
https://www.vicarius.io/vsociety/posts/exploring-opensshs-agent-forwarding-rce-cve-2023-38408

Track CVE-2023-38408 inside VULONE

Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

10.0CVE-2021-44228Apache Log4j2 JNDI lookup remote code executionApache Log4j2 versions 2.0-beta9 through 2.15.0 (excluding 2.12.2, 2.12.3, and 2.3.1) do not protect against attacker-controlled LDAP and other JNDI …KEVEPSS 100%analysed9.8CVE-2024-4577PHP-CGI on Windows argument injection leads to remote code executionPHP-CGI on Windows can misinterpret characters in the command line passed to Win32 API functions when certain code pages are configured, due to Windo…KEVEPSS 100%analysed9.8CVE-2021-44026Roundcube Webmail SQL injection via search parametersRoundcube Webmail before 1.3.17 and 1.4.x before 1.4.12 is prone to SQL injection through the search or search_params input. The flaw is remotely rea…KEVEPSS 70%analysed9.8CVE-2021-42013Apache HTTP Server path traversal and RCE via incomplete fixThe fix for CVE-2021-41773 in Apache HTTP Server 2.4.50 was insufficient, leaving a path traversal flaw that lets attackers map URLs to files outside…KEVEPSS 100%analysed9.8CVE-2021-41773Apache HTTP Server 2.4.49 path traversal and RCEA path normalization flaw introduced in Apache HTTP Server 2.4.49 lets attackers map URLs to files outside directories configured by Alias-like direc…KEVEPSS 100%analysed9.8CVE-2021-1870Apple WebKit logic flaw allows remote code executionA logic issue in Apple's WebKit was addressed with improved restrictions, affecting macOS Big Sur, Catalina, Mojave, iOS and iPadOS, plus WebKitGTK a…KEVEPSS 7.7%analysed9.8CVE-2021-1871Apple WebKit logic flaw allows remote code executionA logic issue in Apple's WebKit was addressed with improved restrictions. It affects macOS Big Sur, Catalina, Mojave, iOS and iPadOS, and a remote at…KEVEPSS 7.0%analysed9.8CVE-2020-16846SaltStack Salt API shell injection via crafted web requestsSaltStack Salt through 3002 is vulnerable to OS command injection when the SSH client is enabled and crafted web requests are sent to the Salt API. T…KEVEPSS 100%analysed

Source: NIST National Vulnerability Database (record CVE-2023-38408), CISA KEV, FIRST EPSS (scores of 2026-09-26). This page is refreshed as NVD updates the record.