Skip to main content
Mallory
CriticalPublic exploitVulnerability

CVE-2023-38408: Remote Code Execution in OpenSSH ssh-agent PKCS#11 Support

Published Jul 20, 2023 · Updated 17 days ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 days3 mentions · peak 1 in a dayToday
CVSS9.8Critical · v3.1
EPSS79.7%100th percentile
CISA KEVNoNot listed
In the wildNonePublic exploit, no exploitation reported
Vendors
Fedora ProjectOpenbsd
IdentifiersCVE-2023-38408CWE-427

OpenSSH before 9.3p2 contains an insufficiently trustworthy library search path in ssh-agent's PKCS#11 support. An attacker with access to a forwarded agent socket can cause specific libraries present on the system running the agent to be loaded and abused for arbitrary code execution on that system. Libraries permitted by the default provider allowlist are not necessarily safe to load. The vulnerability results from an incomplete fix for CVE-2016-10009 and affects the client-side agent rather than constituting a standalone remote vulnerability in sshd.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation permits arbitrary code execution on the machine running ssh-agent with the privileges of the agent process, typically those of the affected user. This can compromise that user's accessible data and resources, permit data modification, and disrupt processes. Merely exposing an SSH server does not establish exploitability; the vulnerable agent must be reachable through forwarding and suitable libraries must be present.

Mitigation

If you can’t patch tonight, do this now.

Disable agent forwarding or avoid forwarding agents to untrusted systems. Alternatively, start ssh-agent with an empty PKCS#11/FIDO provider allowlist using ssh-agent -P '', or restrict the allowlist to explicitly trusted, necessary provider libraries. The remote-provider restriction introduced in OpenSSH 9.3p2 depends on the SSH client identifying forwarded requests; alternative socket-forwarding tools may circumvent that identification.

Remediation

Patch, then assume compromise.

Upgrade OpenSSH to 9.3p2 or later, or install a vendor package containing the complete backported fix. Restart affected agents and SSH sessions using agent forwarding after updating. OpenSSH 9.3p2 blocks remote clients from loading PKCS#11 modules by default; do not restore the previous behavior with -Oallow-remote-pkcs11. For RHEL 8, RHSA-2026:69266 supplies OpenSSH 8.0p1-33.el8_10 to correct an incomplete backport; Rocky Linux provides the corresponding correction through RLSA-2026:69266. For affected Moxa EDS and RKS switches, obtain the vendor patches and upgrade to firmware 4.1.58 and 5.0.4, respectively.

Public exploits

Exploits

3 exploits validated by Mallory's analysis. Hidden: 6 rejected by Mallory's analysis as not a working exploit.

View more in app →
CVE-2023-38408Repository contains a single bash script (2023-38408.sh) implementing an operational PoC for CVE-2023-38408 targeting OpenSSH ssh-agent behavior. The script is highly interactive and appears tailored to a CTF/lab flow (prompts for a 'ROOM IP', provides fixed SSH credentials, and waits for operator input). Core behavior: - Preps environment by deleting /tmp/ssh* and then locating an ssh-agent socket via /tmp/ssh-*/agent.* and exporting it as SSH_AUTH_SOCK. - Uses ssh-add -s with multiple library/provider paths (e.g., /usr/lib/systemd/boot/efi/linuxx64.elf.stub and several .so files), consistent with abusing ssh-agent PKCS#11/provider loading paths implicated in CVE-2023-38408 exploitation chains. - Constructs a large payload using perl (NOP sled + header) concatenated with embedded x86_64 shellcode, and sends it directly to the ssh-agent UNIX socket using netcat (nc -U $SSH_AUTH_SOCK). - The embedded shellcode is intended to spawn a bind shell; the script instructs connecting to nc localhost 31337. Notable additional capability: - Appends a hardcoded SSH public key to /root/.ssh/authorized_keys on the machine running the script, which is a persistence/backdoor action unrelated to pure PoC demonstration and should be treated as malicious behavior if run outside a controlled lab. Structure: - Single file, no supporting modules. Entry point is the bash script itself. The script mixes bash, perl one-liner payload generation, ssh-add invocations, and UNIX-socket communication to the agent.xitexploiter96-dot · Disclosed Jan 24, 2026 · bash · perl · local (ssh-agent UNIX socket abuse / agent forwarding scenario)Operationalssh-enumThis repository is a Python-based SSH user-enumeration research and detection project rather than a single weaponized exploit. Its offensive capability is network-based probing of SSH services to determine whether usernames can be distinguished through authentication behavior, timing differences, or tool-assisted enumeration. The main orchestrator is run_investigation.py, which executes a multi-stage pipeline: raw SSH banner grabbing and version parsing, repeated Paramiko authentication attempts against candidate usernames, statistical timing analysis for CVE-2016-6210-style leakage, and auth.log-based detection engineering. Repository structure is split cleanly into attack_tools and detection_tools. attack_tools/banner_fingerprinter.py opens a raw TCP socket to the SSH port, captures the pre-auth banner, extracts implementation/version/OS hints, and maps versions against a small local CVE registry including CVE-2016-6210, CVE-2023-38408, and CVE-2024-6387. attack_tools/manual_ssh.py is the core probing component: it uses Paramiko to attempt password authentication for each username, records elapsed time until AuthenticationException or connection failure, caches the remote SSH banner, and saves structured JSON results. attack_tools/hydra_automation.py and attack_tools/metasploit_scanner.py are wrappers around external tools; they automate Hydra and Metasploit auxiliary/scanner/ssh/ssh_enumuser respectively, parse outputs, and save findings. The detection side is substantial. detection_tools/log_parser.py parses SSH-related auth.log events such as failed password, invalid user, accepted login, and disconnects. detection_tools/pattern_detector.py identifies rapid username cycling from one IP, wordlist correlation, evenly spaced attempts suggesting automation, and distributed probing of the same username from multiple IPs. detection_tools/response_analyzer.py performs Welch’s t-test and Cohen’s d calculations to decide whether valid and invalid usernames are distinguishable by timing. alerting_system.py formats alerts. The repository also includes notebooks for exploratory analysis, wordlists of common usernames, saved JSON outputs from prior runs, and unit tests. Main exploit capabilities: (1) unauthenticated SSH banner fingerprinting over TCP/22; (2) repeated password-auth attempts against many usernames to test for enumeration leakage; (3) optional automation of Hydra and Metasploit enumeration workflows; (4) statistical determination of whether timing differences imply username existence; and (5) post-event detection/reporting from SSH logs. There is no custom RCE payload or shell delivery. The practical result is reconnaissance and validation of SSH username enumeration exposure, plus defender-focused detection artifacts. Based on the included results, the tested OpenSSH 8.9p1 target did not appear vulnerable to timing-based username enumeration, though its banner exposed version information and matched CVE ranges in the local triage registry.Alisha-chaudhary · Disclosed Apr 30, 2026 · python · json · networkOperationalCVE-2023-38408This repository contains a Bash proof-of-concept exploit for CVE-2023-38408, a remote code execution vulnerability in OpenSSH's ssh-agent forwarding (affecting versions prior to 9.3p2). The exploit is tailored for the TryHackMe lab environment and automates the attack process. The main script, 'CVE-2023-38408.sh', guides the user through setting up the attack, including SSH access to the victim, manipulation of ssh-agent sockets, and sideloading of malicious libraries. It delivers custom x86_64 shellcode to the victim's ssh-agent via a Unix socket, ultimately opening a bind shell on port 31337. The script interacts with several system files and libraries, and requires the attacker to have SSH credentials for the victim. The README provides context and usage notes, emphasizing that the exploit is intended for educational use within the TryHackMe environment. No external network endpoints or domains are hardcoded; all targeting is local to the victim and attacker machines within the lab.kali-mx · Disclosed Aug 9, 2023 · bash · networkPoC
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
Fedora ProjectFedoraoperating_system
OpenbsdOpensshapplication
FAQ

Frequently asked questions

Is CVE-2023-38408 exploited in the wild?
As of Nov 6, 2026, Mallory has no reports of CVE-2023-38408 being exploited in the wild. It is not listed in CISA KEV.
Is there a public exploit for CVE-2023-38408?
Yes. Mallory tracks 3 public exploits or proofs of concept for CVE-2023-38408, the earliest disclosed Aug 9, 2023.
Is there a patch for CVE-2023-38408?
Upgrade OpenSSH to 9.3p2 or later, or install a vendor package containing the complete backported fix. Restart affected agents and SSH sessions using agent forwarding after updating.
What products are affected by CVE-2023-38408?
Openbsd Openssh and Fedora Project Fedora.
How severe is CVE-2023-38408?
CVE-2023-38408 has a CVSS v3.1 score of 9.8 (Critical) and an EPSS score of 79.7% (100th percentile) as of Nov 6, 2026.
Activity feed

Recent activity

30 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
tenable nessus pluginsNews · Nov 5, 2026CentOS Linux 7.9 [CIQ] Security Update: openssh / openssh-askp... | Tenable®A critical OpenSSH vulnerability covered by the CIQ security update. Its cited CVSS v3 vector indicates network access, low attack complexity, no privileges or user interaction, and high confidentiality, integrity, and availability impacts. The reference does not individually attribute exploitation activity.Read more ↗tenable nessus pluginsNews · Nov 2, 2026Photon OS 5.0: Openssh PHSA-2023-5.0-90-0057 | Tenable®A critical vulnerability affecting the OpenSSH package on Photon OS 5.0, referenced by Nessus plugin 374959. The advisory reports a CVSS v3 base score of 9.8 and available exploits. Security updates were published on July 26, 2023; the recommended remediation is to update the affected Linux packages. The content does not describe the underlying vulnerability mechanism.Read more ↗tenable nessus pluginsNews · Nov 1, 2026Rocky Linux 8.6 [CIQ] Security Update: openssh / openssh-askpa... | Tenable®An OpenSSH vulnerability covered by the CIQ LTS 8.6 update and used as the plugin's CVSS v2 scoring reference. The content does not describe its exploitation mechanism or individually establish exploit availability.Read more ↗tenable nessus pluginsNews · Sep 23, 2026MiracleLinux 8 : openssh-8.0p1-33.el8_10 (AXSA:2026-1886:10) | Tenable®A high-severity OpenSSH-related vulnerability addressed by the Miracle Linux security advisory/plugin for Miracle Linux 8 OpenSSH packages.Read more ↗
+15 more in the timeline. Sign up to see them
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidenceEvery report linking this CVE to a named adversary.
Associated malwareMalware families linked to this CVE, with evidence and IOCs.
Detection signaturesYARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity6Community discussion across Reddit, Mastodon, and other social sources.