The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2023-38408

CVE-2023-38408: OpenBSD OpenSSH RCE Vulnerability

CVE-2023-38408 is a remote code execution flaw in OpenBSD OpenSSH ssh-agent affecting versions before 9.3p2. This vulnerability exploits an insufficiently trustworthy search path. This article covers technical details, impact, and mitigation.

Updated: May 15, 2026

CVE-2023-38408 Overview

CVE-2023-38408 is a remote code execution vulnerability in the PKCS#11 feature of ssh-agent in OpenSSH versions prior to 9.3p2. The flaw stems from an insufficiently trustworthy search path used when loading PKCS#11 provider libraries. When a user forwards their SSH agent to an attacker-controlled system, the attacker can load arbitrary shared libraries from /usr/lib into ssh-agent and chain them to achieve code execution on the victim's workstation. The issue exists because of an incomplete fix for CVE-2016-10009. Qualys researchers demonstrated working exploitation against default installations on several Linux distributions, making the issue widely applicable across enterprise environments.

Critical Impact

Attackers who control an SSH server can execute arbitrary code on any client that forwards an ssh-agent connection to that server, leading to full compromise of the user's workstation.

Affected Products

  • OpenBSD OpenSSH versions before 9.3p2 (including 9.3 and 9.3p1)
  • Fedora 37 and Fedora 38
  • Downstream distributions including Debian, Gentoo, NetApp ONTAP, and Apple macOS (addressed in HT213940)

Discovery Timeline

  • 2023-07-19 - Qualys Threat Research Unit publishes analysis and OpenBSD commits the upstream fix
  • 2023-07-20 - CVE-2023-38408 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2023-38408

Vulnerability Analysis

The vulnerability is classified as an Untrusted Search Path issue [CWE-428] within the PKCS#11 provider loading logic of ssh-agent. When a client forwards its agent to a remote host, the remote host can send SSH_AGENTC_ADD_SMARTCARD_KEY messages back to the local agent. These messages instruct the agent to dlopen() a shared library by path. The pre-patch code only restricted absolute paths but allowed any library reachable via the dynamic linker's search path, including /usr/lib. Qualys demonstrated that by repeatedly loading and unloading specific stock libraries from /usr/lib, an attacker could side-effect the agent's memory layout and chain gadgets to reach system() or equivalent execution primitives. Each forwarded message executes inside the trusted local ssh-agent process, bypassing the protections normally afforded by agent forwarding.

Root Cause

The root cause is the agent's willingness to load arbitrary shared objects requested by a forwarded peer without verifying that the object is a legitimate PKCS#11 provider. The original fix for CVE-2016-10009 blocked path traversal but did not restrict which libraries within standard system directories could be loaded. Standard system libraries are not designed to be safely loaded and unloaded into an arbitrary host process, and their constructors and destructors can be weaponized.

Attack Vector

Exploitation requires that a victim connect to an attacker-controlled SSH server with agent forwarding enabled (ssh -A or ForwardAgent yes). Once connected, the attacker uses the forwarded agent socket to issue add-smartcard-key requests that load chosen libraries from /usr/lib. By chaining the side effects of multiple library load and unload operations, the attacker achieves arbitrary code execution in the context of the user running ssh-agent on the originating host.

c
/* Patch: usr.bin/ssh/ssh-pkcs11.c
 * Terminate process if requested to load a PKCS#11 provider
 * that does not contain the expected symbols.
 */
-/* $OpenBSD: ssh-pkcs11.c,v 1.56 2023/03/08 05:33:53 tb Exp $ */
+/* $OpenBSD: ssh-pkcs11.c,v 1.57 2023/07/19 13:55:53 djm Exp $ */
 /*
  * Copyright (c) 2010 Markus Friedl.  All rights reserved.
  * Copyright (c) 2014 Pedro Martelletto. All rights reserved.

Source: OpenBSD Commit f03a4fa

c
/* Patch: usr.bin/ssh/misc.c
 * Ensure FIDO/PKCS11 libraries contain expected symbols before loading.
 */
-/* $OpenBSD: misc.c,v 1.183 2023/07/14 07:44:21 dtucker Exp $ */
+/* $OpenBSD: misc.c,v 1.184 2023/07/19 14:02:27 djm Exp $ */

Source: OpenBSD Commit f8f5a6b

Detection Methods for CVE-2023-38408

Indicators of Compromise

  • Unexpected dlopen() calls from the ssh-agent process targeting libraries under /usr/lib that are not legitimate PKCS#11 providers.
  • Child processes spawned by ssh-agent, which should not occur during normal operation.
  • Outbound network connections originating from ssh-agent or processes that inherit its environment.
  • SSH client sessions using ForwardAgent yes to untrusted or recently registered hosts.

Detection Strategies

  • Hunt for process lineage where ssh-agent is the parent of unexpected binaries such as shells, interpreters, or network utilities.
  • Inspect auditd or eBPF telemetry for execve and open events initiated by ssh-agent referencing shared objects outside the OpenSSH package.
  • Correlate SSH client logs showing agent forwarding with subsequent anomalous activity on the originating workstation.

Monitoring Recommendations

  • Track installed OpenSSH versions across the fleet and alert on hosts running versions earlier than 9.3p2.
  • Monitor SSH client configuration files for ForwardAgent yes directives applied to wildcard host patterns.
  • Log and review every interactive SSH session that requests agent forwarding to externally hosted systems.

How to Mitigate CVE-2023-38408

Immediate Actions Required

  • Upgrade OpenSSH to version 9.3p2 or later on all clients that may forward an agent connection.
  • Apply vendor-supplied patches from Debian, Fedora, Gentoo, NetApp, and Apple (macOS update HT213940).
  • Disable agent forwarding by default and re-enable it only for explicitly trusted destinations.
  • Audit user ~/.ssh/config files and centrally managed SSH configurations for unsafe ForwardAgent defaults.

Patch Information

OpenSSH 9.3p2 introduces three upstream fixes: commit 7bc29a9 disallows remote addition of FIDO and PKCS#11 provider libraries to ssh-agent by default, commit f03a4fa terminates the process if a requested provider lacks expected symbols, and commit f8f5a6b validates that FIDO and PKCS#11 libraries contain the expected entry points before loading. See the OpenSSH 9.3p2 release notes and the Qualys advisory for full details.

Workarounds

  • Set ForwardAgent no globally in /etc/ssh/ssh_config and only enable it per-host for trusted endpoints.
  • Use the -o AddKeysToAgent=confirm option or ssh-agent -P allowlist (available in newer OpenSSH releases) to restrict which providers may be loaded.
  • Prefer ProxyJump (ssh -J) over agent forwarding for multi-hop SSH workflows.
  • Use hardware-backed keys with FIDO authenticators (ed25519-sk) that do not require forwarding the full agent.
bash
# /etc/ssh/ssh_config - safe defaults
Host *
    ForwardAgent no
    AddKeysToAgent confirm

# Restrict allowed PKCS#11 providers in ssh-agent (OpenSSH >= 9.3p2)
ssh-agent -P '/usr/lib64/pkcs11/opensc-pkcs11.so'

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechOpenssh

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability67.24%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-428
  • Technical References
  • Packet Storm Remote Code Execution

  • OpenWall OSS Security Mail #1

  • OpenWall OSS Security Mail #2

  • OpenWall OSS Security Mail #11

  • OpenWall OSS Security Mail #9

  • Qualys Analysis of CVE-2023-38408

  • Debian LTS Security Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Gentoo GLSA 2023-07-01

  • NetApp Security Advisory NTAP-20230803-0010

  • Apple Security Advisory HT213940

  • OpenSSH Release 9.3p2

  • Qualys RCE Vulnerability Overview

  • Vicarius Blog on CVE-2023-38408
  • Vendor Resources
  • OpenBSD Commit 7bc29a9

  • OpenBSD Commit f03a4fa

  • OpenBSD Commit f8f5a6b

  • Hacker News Discussion #36790196

  • OpenSSH Security Page
  • Related CVEs
  • CVE-2026-35386: OpenSSH RCE Vulnerability via Metacharacters

  • CVE-2025-61984: OpenSSH RCE Vulnerability

  • CVE-2023-51385: OpenBSD OpenSSH RCE Vulnerability

  • CVE-2020-15778: OpenSSH SCP Command Injection Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English