Don’t let overlooked obligations become incidents. Learn how.
Utility navigation bar redirect icon
Portal LoginSupportContact
Search
Close search
Huntress Logo in Teal
  • Platform Overview
    Managed EDR

    Get full endpoint visibility, detection, and response.

    Managed EDR

    Get full endpoint visibility, detection, and response.

    Managed ITDR

    Protect your Microsoft 365 and Google Workspace identities and email environments.

    Managed ITDR

    Protect your Microsoft 365 and Google Workspace identities and email environments.

    Managed SIEM

    Managed threat response and robust compliance support at a predictable price.

    Managed SIEM

    Managed threat response and robust compliance support at a predictable price.

    Managed Security Awareness Training

    Empower your teams with science-backed security awareness training.

    Managed Security Awareness Training

    Empower your teams with science-backed security awareness training.

    Managed ISPM

    Continuous Microsoft 365 and identity hardening, managed and enforced by Huntress experts.

    Managed ISPM

    Continuous Microsoft 365 and identity hardening, managed and enforced by Huntress experts.

    Managed ESPM

    Proactively secure endpoints against attacks.

    Managed ESPM

    Proactively secure endpoints against attacks.

    Integrations
    Integrations
    Support Documentation
    Support Documentation
    See Huntress in Action

    Quickly deploy and manage real-time protection for endpoints, email, and employees - all from a single dashboard.

    Huntress Cybersecurity
    See Huntress in Action

    Quickly deploy and manage real-time protection for endpoints, email, and employees - all from a single dashboard.

    Huntress Cybersecurity
  • Threats We Stop
    Phishing
    Phishing
    Business Email Compromise
    Business Email Compromise
    Ransomware
    Ransomware
    Infostealers
    Infostealers
    View Allright arrowView Allright arrow
    Industries We Serve
    Education
    Education
    Financial Services
    Financial Services
    State and Local Government
    State and Local Government
    Healthcare
    Healthcare
    Law Firms
    Law Firms
    Manufacturing
    Manufacturing
    Utilities
    Utilities
    View Allright arrowView Allright arrow
    Tailored Solutions
    MSPs
    MSPs
    Resellers
    Resellers
    SMBs
    SMBs
    Compliance
    Compliance
    What Gets Overlooked Gets Exploited

    Most days, nothing happens. But one day, something will.

    Huntress Cybersecurity
    Cybercriminals Have Evolved

    Get the intel on today’s cybercriminal groups and learn how to protect yourself.

    Huntress Cybersecurity
  • Pricing
  • Community Series
    The Product Lab

    Shape the next big thing in cybersecurity together.

    The Product Lab

    Shape the next big thing in cybersecurity together.

    Fireside Chat

    Real people. Real perspectives. Better conversations.

    Fireside Chat

    Real people. Real perspectives. Better conversations.

    Tradecraft Tuesday

    No products, no pitches – just tradecraft.

    Tradecraft Tuesday

    No products, no pitches – just tradecraft.

    _declassified

    Exposing hidden truths in the world of cybersecurity.

    _declassified

    Exposing hidden truths in the world of cybersecurity.

    Resources
    Upcoming Events
    Upcoming Events
    Ebooks
    Ebooks
    On-Demand Webinars
    On-Demand Webinars
    Videos
    Videos
    Whitepapers
    Whitepapers
    Datasheets
    Datasheets
    Cybersecurity Education
    Cybersecurity 101
    Cybersecurity 101
    Cybersecurity Guides
    Cybersecurity Guides
    Threat Library
    Threat Library
    Real Tradecraft, Real Results
    Real Tradecraft, Real Results
    2026 Cyber Threat Report
    2026 Cyber Threat Report
    The Huntress Blog
    Huntress Lands on the Microsoft Marketplace
    Huntress Cybersecurity
    Huntress Lands on the Microsoft Marketplace
    Huntress Cybersecurity
    How Huntress & DEFCERT Are Streamlining CMMC Assessment Prep
    Huntress Cybersecurity
    How Huntress & DEFCERT Are Streamlining CMMC Assessment Prep
    Huntress Cybersecurity
    Live Hacking Into Microsoft 365 with Kyle Hanslovan
    Huntress Cybersecurity
    Live Hacking Into Microsoft 365 with Kyle Hanslovan
    Huntress Cybersecurity
  • Why Huntress

    Go beyond AI in the fight against today’s hackers with Huntress Managed EDR purpose-built for your needs

    Huntress Cybersecurity
    Why Huntress

    Go beyond AI in the fight against today’s hackers with Huntress Managed EDR purpose-built for your needs

    Huntress Cybersecurity
    The Huntress SOC

    24/7 Security Operations Center

    The Huntress SOC

    24/7 Security Operations Center

    Reviews

    Why businesses of all sizes trust Huntress to defend their assets

    Reviews

    Why businesses of all sizes trust Huntress to defend their assets

    Case Studies

    Learn directly from our partners how Huntress has helped them

    Case Studies

    Learn directly from our partners how Huntress has helped them

    Community

    Get in touch with the Huntress Community team

    Community

    Get in touch with the Huntress Community team

    Compare Huntress
    Bitdefender
    Bitdefender
    Blackpoint
    Blackpoint
    Breach Secure Now!
    Breach Secure Now!
    Crowdstrike
    Crowdstrike
    Datto
    Datto
    SentinelOne
    SentinelOne
    Sophos
    Sophos
    Compare Allright arrowCompare Allright arrow
  • HUNTRESS HUB

    Login to access top-notch marketing resources, tools, and training.

    Huntress Cybersecurity
    HUNTRESS HUB

    Login to access top-notch marketing resources, tools, and training.

    Huntress Cybersecurity
    Partners
    MSPs

    Join our partner community to deliver expert-led managed security.

    MSPs

    Join our partner community to deliver expert-led managed security.

    Resellers

    Partner program designed to grow your cybersecurity business.

    Resellers

    Partner program designed to grow your cybersecurity business.

    Tech Alliances

    Driving innovation through global technology Partnerships

    Tech Alliances

    Driving innovation through global technology Partnerships

    Microsoft Partnership

    A Level-Up for Your Business Security

    Microsoft Partnership

    A Level-Up for Your Business Security

  • Press Release
    Huntress Announces Collaboration with Microsoft to Strengthen Cybersecurity for Businesses of All Sizes
    Huntress Cybersecurity
    Press Release
    Huntress Announces Collaboration with Microsoft to Strengthen Cybersecurity for Businesses of All Sizes
    Huntress Cybersecurity
    Our Story

    We're on a mission to shatter the barriers to enterprise-level security.

    Our Story

    We're on a mission to shatter the barriers to enterprise-level security.

    Newsroom

    Explore press releases, news articles, media interviews and more.

    Newsroom

    Explore press releases, news articles, media interviews and more.

    Meet the Team

    Founded by former NSA Cyber Operators. Backed by security researchers.

    Meet the Team

    Founded by former NSA Cyber Operators. Backed by security researchers.

    Careers

    Ready to shake up the cybersecurity world? Join the hunt.

    Careers

    Ready to shake up the cybersecurity world? Join the hunt.

    Awards
    Awards
    Contact Us
    Contact Us
  • Portal Login
  • Support
  • Contact
  • Search
  • Get a Demo
  • Start for Free
Portal LoginSupportContact
Search
Close search
Get a Demo
Start for Free
HomeThreat LibraryVulnerabilities
CVE-2023-51385

CVE-2023-51385 Vulnerability

Published: 11/07/2025

Written by: Monica Burgess

Glitch effectGlitch effect

CVE-2023-51385 is a command injection vulnerability in OpenSSH's proxy command feature. An attacker could exploit this flaw by tricking a user or an automated process into connecting to a malicious server with a specially crafted hostname. This could allow the attacker to execute arbitrary commands on the client's machine, posing a significant security risk.

Alright, let's talk about a tricky one. CVE-2023-51385 is a remote code execution (RCE) vulnerability found in OpenSSH, one of the most widely used tools for secure remote connections. Specifically, the flaw exists in how some versions of the SSH client handle hostnames when using the ProxyCommand option. An attacker can craft a malicious hostname that, when used, allows them to execute arbitrary commands on the machine initiating the SSH connection. Think of it as a backdoor that gets opened by a seemingly normal connection attempt.

What is CVE-2023-51385 Vulnerability?

CVE-2023-51385 is a command injection vulnerability affecting the client side of OpenSSH. The issue arises when the ProxyCommand feature is used with a hostname containing shell metacharacters (like backticks `). Because the client-side code in vulnerable versions doesn't properly sanitize the hostname before passing it to the shell for execution, an attacker can embed commands within the hostname. If a user or automated system tries to connect to this malicious hostname, the embedded commands will run on their local machine with their permissions. Yikes.

When was it Discovered?

The vulnerability was publicly disclosed on December 18, 2023. The issue was discovered by security researchers who identified the flawed input validation in the OpenSSH source code. Following responsible disclosure practices, the details were released after a patch was made available by the OpenSSH developers, allowing system administrators time to update their systems before the exploitability became widely known.

Affected Products & Versions

The vulnerability specifically impacts OpenSSH versions before 9.6. If you're using ProxyCommand or a similar feature that relies on it (like ProxyJump with certain configurations), you'll want to check your version ASAP.

Product

Versions Affected

Fixed Versions / Patch Link

OpenSSH

Versions before 9.6

9.6 and later / OpenSSH 9.6 Release Notes

CVE-2023-51385 Technical Description

Let's get into the weeds. The root cause of the CVE-2023-51385 vulnerability lies in a lack of input sanitization within the OpenSSH client. When an SSH connection is initiated using the ProxyCommand option, the client expands tokens like %h (hostname) and %p (port) before passing the resulting string to a shell for execution.

The problem is that if the hostname (%h) contains shell metacharacters, such as backticks (), they are not escaped or removed. The client code essentially builds a command string and hands it off to /bin/sh. For example, a malicious command could look like this: ssh -o ProxyCommand='ssh -W "attacker-command":22 proxy' user@host. The inner command, attacker-command`, would execute on the client's machine.

This flaw is particularly dangerous in environments where hostnames are not fully trusted, such as Git repositories with submodules pointing to malicious URLs or in automated scripts that connect to various hosts.

Tactics, Techniques & Procedures (TTPs)

Threat actors exploiting the CVE-2023-51385 vulnerability typically use social engineering or supply chain manipulation to get a victim to connect to a malicious hostname. A common TTP involves embedding a crafted SSH URL in a project's configuration file (e.g., a .gitmodules file). When a developer clones the repository and initializes submodules, their SSH client could unknowingly execute the embedded payload. This allows the attacker to achieve initial access and potentially move laterally within the network.

Indicators of Compromise

Detecting an active exploit of this vulnerability can be tricky since the initial connection might look legitimate. However, there are a few Indicators of Compromise (IOCs) to watch for. Keep an eye on shell execution logs (bash_history, zsh_history) for suspicious ssh commands that include oddly formatted hostnames or backticks. You should also monitor for unexpected outbound network connections or processes being spawned by an SSH client process, especially if they are running with user-level privileges.

Known Proof-of-Concepts & Exploits

Shortly after disclosure, several security researchers developed and published proof-of-concept (PoC) exploits for CVE-2023-51385. These PoCs demonstrated how a malicious hostname could be used to launch applications, like a calculator, on the client's machine to prove code execution. While there have been no widespread, large-scale campaigns reported as of early 2025, the public availability of these PoCs means that threat actors have the tools to incorporate this CVE-2023-51385 exploit into their attacks. The exploitability is straightforward for anyone who can convince a target to use a crafted hostname.

How to Detect CVE-2023-51385 Vulnerability?

The best way to "detect" the vulnerability is to check your OpenSSH client version. On most Linux systems, you can run ssh -V in your terminal. If the reported version is below 9.6, you are vulnerable. For host-based detection, you can use an Endpoint Detection and Response (EDR) solution to monitor for unusual process chains originating from ssh. For example, an ssh process spawning a shell or other unexpected applications is a major red flag. SIEM rules can also be configured to alert on SSH commands in logs that contain shell metacharacters in the hostname argument.

Impact & Risk of CVE-2023-51385 Vulnerability

The impact of this vulnerability can be severe. An attacker who successfully exploits it gains the ability to execute code with the same privileges as the user running the SSH client. If that user is a developer with sudo rights or access to sensitive infrastructure, the attacker could escalate privileges, exfiltrate data, install persistent malware, or pivot to other systems on the network. The business risk includes data breaches, intellectual property theft, and system downtime. In short, it’s a pretty big deal.

Mitigation & Remediation Strategies

Stop what you're doing and patch! The primary and most effective mitigation is to update OpenSSH to version 9.6 or later. This version includes a fix that properly sanitizes hostnames to prevent command injection.

If you can't update immediately, you have a couple of options, but they're not as good as patching:

  • Avoid Untrusted Hostnames: Be extremely cautious about the hostnames you and your automated systems connect to. Don't clone Git repositories from untrusted sources or connect to SSH servers without verifying the hostname.

  • Restrict ProxyCommand: If possible, disable or strictly limit the use of ProxyCommand in your global and user-specific SSH configuration files (/etc/ssh/ssh_config and ~/.ssh/config).

Ultimately, patching is the only surefire way to remediate this vulnerability. Don't wait.

CVE-2023-51385 Vulnerability FAQs

CVE-2023-51385 is a command injection vulnerability in the OpenSSH client. It works by tricking the client into executing commands hidden within a specially crafted hostname when using the ProxyCommand feature. The client fails to properly clean the hostname, allowing malicious code to run on the user's machine.

This isn't a traditional virus; it's an exploit that requires user interaction. An attacker needs to convince a user or an automated script to initiate an SSH connection to a malicious server address. This is often done by embedding the malicious address in a project file, like a Git submodule, which the user then accesses.

Yes, it's absolutely still a threat. Any system running an unpatched version of OpenSSH (before 9.6) remains vulnerable. Given the widespread use of OpenSSH and the public availability of exploit code, it's an attractive target for attackers looking for an easy way into a network.

The best protection is patching. Organizations must update all OpenSSH clients to version 9.6 or newer. Additionally, they should use security tools to monitor for suspicious process activity and educate developers on the risks of connecting to untrusted hosts.

Glitch effectBlurry glitch effect

Protect What Matters

Secure endpoints, email, and employees with the power of our 24/7 SOC. Try Huntress for free and deploy in minutes to start fighting threats.
Try Huntress for Free
Huntress Managed Security PlatformManaged EDRManaged EDR for macOSManaged EDR for LinuxManaged ITDRManaged SIEMManaged Security Awareness TrainingManaged ISPMManaged ESPMBook a Demo
PhishingComplianceBusiness Email CompromiseEducationFinanceHealthcareManufacturingState & Local Government
Managed Service ProvidersResellersIT & Security Teams24/7 SOCCase Studies
BlogResource CenterCybersecurity 101Upcoming EventsSupport Documentation
Our CompanyLeadershipNews & PressCareersContact Us
Huntress white logo

Protecting 215k+ customers like you with enterprise-grade protection.

Privacy PolicyCookie PolicyTerms of UseCookie Consent
Linkedin iconTwitter X iconYouTube iconInstagram icon
© 2025 Huntress All Rights Reserved.

Join the Hunt

Get insider access to Huntress tradecraft, killer events, and the freshest blog updates.

By submitting this form, you accept our Terms of Service & Privacy Policy