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
    • 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-2026-35386

CVE-2026-35386: OpenSSH RCE Vulnerability via Metacharacters

CVE-2026-35386 is a remote code execution flaw in OpenSSH before version 10.3 that allows command execution through shell metacharacters in usernames. This article covers technical details, affected versions, and mitigation.

Published: April 2, 2026

CVE-2026-35386 Overview

CVE-2026-35386 is a command injection vulnerability in OpenSSH versions prior to 10.3. The vulnerability allows command execution via shell metacharacters embedded in a username within a command line. Exploitation requires a specific scenario where the username on the command line is untrusted, combined with non-default configurations using the % token expansion in ssh_config.

Critical Impact

Attackers can achieve arbitrary command execution on systems with non-default OpenSSH configurations that process untrusted usernames through shell metacharacter injection.

Affected Products

  • OpenSSH versions before 10.3
  • OpenSSH portable versions before 10.3p1
  • Systems using non-default % token configurations in ssh_config

Discovery Timeline

  • 2026-04-02 - CVE-2026-35386 published to NVD
  • 2026-04-02 - Last updated in NVD database

Technical Details for CVE-2026-35386

Vulnerability Analysis

This vulnerability falls under CWE-696 (Incorrect Behavior Order) and represents a command injection flaw in OpenSSH's handling of username parameters. The issue arises when OpenSSH processes usernames containing shell metacharacters in command-line arguments, particularly when the ssh_config file uses % token expansion directives.

When a system administrator configures OpenSSH with percent token expansions (such as %u for username or %h for hostname) in directives like ProxyCommand, LocalCommand, or similar configuration options, the username provided on the command line may be interpolated into shell commands without proper sanitization. This allows an attacker who controls the username input to inject arbitrary shell commands.

The vulnerability requires specific preconditions: the username must originate from an untrusted source, and the OpenSSH configuration must employ % token expansion in a way that passes user-controlled data to a shell context. While these conditions limit the attack surface, environments that meet these criteria are exposed to potential command execution.

Root Cause

The root cause is improper sanitization of shell metacharacters in username parameters before they are processed through % token expansion in ssh_config directives. When configuration options like ProxyCommand or LocalCommand use %u (username) or similar tokens, the expanded values are passed to the shell for execution. If the username contains metacharacters such as ;, |, $(), or backticks, these can break out of the intended command context and execute arbitrary commands.

Attack Vector

The attack requires local access and involves an attacker providing a maliciously crafted username containing shell metacharacters when initiating an SSH connection. The attack exploits the token expansion mechanism in non-default ssh_config configurations.

For example, if an administrator has configured a ProxyCommand directive that uses %u for username expansion, an attacker could craft a username like user$(malicious_command) or user;malicious_command; to inject commands that execute when the SSH client processes the connection request.

The vulnerability mechanism involves the following sequence:

  1. User provides a malicious username via command line to the SSH client
  2. OpenSSH reads ssh_config containing % token expansion directives
  3. The username is expanded within shell command contexts without proper escaping
  4. Shell metacharacters in the username are interpreted, allowing command injection

Technical details and discussion can be found in the OpenSSH Development Discussion and Openwall OSS Security Mailing List.

Detection Methods for CVE-2026-35386

Indicators of Compromise

  • Unusual SSH client process spawning unexpected child processes
  • SSH connection attempts with usernames containing shell metacharacters (;, |, $, backticks, &)
  • Suspicious command execution patterns originating from SSH client processes
  • Log entries showing malformed or unusual username patterns in authentication attempts

Detection Strategies

  • Monitor SSH client command-line arguments for usernames containing shell metacharacters
  • Audit ssh_config files for usage of % token expansion in potentially dangerous directives such as ProxyCommand, LocalCommand, PermitLocalCommand, and similar options
  • Implement endpoint detection rules to identify process trees where SSH clients spawn unexpected shell commands
  • Review system logs for SSH connections with unusual username patterns

Monitoring Recommendations

  • Enable verbose SSH logging to capture connection details including usernames
  • Deploy file integrity monitoring on ssh_config and ~/.ssh/config files to detect unauthorized modifications
  • Monitor for process creation events where SSH client binaries spawn shell processes with unexpected arguments
  • Implement network-level monitoring for SSH connections with anomalous username formats

How to Mitigate CVE-2026-35386

Immediate Actions Required

  • Upgrade OpenSSH to version 10.3 or 10.3p1 or later immediately
  • Audit all ssh_config and user-level SSH configuration files for % token usage
  • Review and restrict sources of untrusted username input in automated SSH connection scripts
  • Consider removing or sanitizing %u and similar user-controlled token expansions from configuration files until patching is complete

Patch Information

OpenSSH has addressed this vulnerability in version 10.3 and 10.3p1. The patch implements proper escaping and sanitization of shell metacharacters in username parameters before they are processed through % token expansion. Detailed release information is available in the OpenSSH Release Notes 10.3p1.

Organizations should update to the patched version through their distribution's package manager or compile from source. Verify the installed version after patching using ssh -V.

Workarounds

  • Remove % token expansions that reference user-controlled values (such as %u) from ProxyCommand, LocalCommand, and similar directives in ssh_config
  • Implement input validation on any automated systems that pass usernames to SSH commands, rejecting usernames containing shell metacharacters
  • Use wrapper scripts that sanitize username inputs before passing them to SSH client commands
  • Restrict SSH client configurations to use only trusted, hardcoded values rather than dynamic token expansions
bash
# Configuration example
# Review and modify ssh_config to avoid dangerous % expansions
# Before (potentially vulnerable):
# Host example
#     ProxyCommand /usr/bin/nc -x proxy:1080 %h %p -u %u

# After (safer configuration using static values):
# Host example
#     ProxyCommand /usr/bin/nc -x proxy:1080 %h %p

# Verify OpenSSH version after upgrade
ssh -V
# Expected output: OpenSSH_10.3p1 or higher

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechOpenssh

  • SeverityLOW

  • CVSS Score3.6

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-696
  • Technical References
  • OpenSSH Development Discussion

  • OpenSSH Release Notes 10.3p1

  • Openwall OSS Security Mailing List
  • Related CVEs
  • CVE-2025-61984: OpenSSH RCE Vulnerability

  • CVE-2023-51385: OpenBSD OpenSSH RCE Vulnerability

  • CVE-2020-15778: OpenSSH SCP Command Injection Vulnerability

  • CVE-2024-6409: OpenSSH sshd Race Condition RCE Vulnerability
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now 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