Skip to main content
Mallory
MediumPublic exploitVulnerability

CVE-2023-51385: OS Command Injection in OpenSSH Expansion Tokens

Published Dec 18, 2023 · Updated 18 days ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 days1 mention · peak 1 in a dayToday
CVSS6.5Medium · v3.1
EPSS19.8%97th percentile
CISA KEVNoNot listed
In the wildNonePublic exploit, no exploitation reported
Vendors
Debian ProjectOpenbsd
IdentifiersCVE-2023-51385CWE-78 · Improper Neutralization of Special…

CVE-2023-51385 is an OS command injection vulnerability in the OpenSSH SSH client before version 9.6. User names or host names containing shell metacharacters can be interpreted as shell syntax when substituted through expansion tokens into shell-executed commands, such as those configured with ProxyCommand. An attacker-controlled Git repository can supply a malicious SSH user name or host name through a submodule definition. If the client processes that value under an affected configuration, arbitrary commands can execute on the client system with the privileges of the user invoking SSH.

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 command execution on the system running the SSH client. Depending on the invoking user's privileges, an attacker could access sensitive information, modify files, or disrupt services. This is a client-side command injection issue, not a general unauthenticated compromise of an exposed SSH server.

Mitigation

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

Limit system access to trusted users and validate SSH user names and host names for shell metacharacters before allowing them to enter shell-executed expansion contexts, particularly ProxyCommand. Avoid processing untrusted Git submodule SSH destinations with affected client configurations until updates are installed.

Remediation

Patch, then assume compromise.

Upgrade OpenSSH to version 9.6 or later, or install the applicable vendor package containing backported fixes. Update affected container images and rebuild dependent images where OpenSSH is embedded. For HPE Aruba access points, the specified fixed releases are AOS-10 AP 10.8.0.0 or later and AOS-8 Instant 8.13.0.0 or later; migrate affected end-of-maintenance releases to a supported fixed release.

Public exploits

Exploits

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

View more in app →
cve-2023-51385This repository is a small exploit/PoC for CVE-2023-51385 centered on malicious Git submodule URL handling. The structure is minimal: a README explaining setup and trigger conditions, a .gitmodules file containing the malicious submodule URL, and a bash payload script (shell.sh). The exploit abuses command substitution embedded in the submodule URL field, e.g. ssh://`bash shell.sh`foo.ichunqiu.com/bar, so that when a victim performs a recursive clone/submodule operation in a vulnerable environment, arbitrary local commands may execute. The README documents both a safe proof-of-execution payload (creating cve.txt) and the actual repository payload. It states that exploitation requires a vulnerable OpenSSH version earlier than 9.6p1 and an SSH client configuration with a ProxyCommand rule matching the crafted host pattern. Operationally, this is more than a pure detection script because the included shell.sh launches a real reverse shell using bash TCP redirection to 64.90.7.213:8889. Primary capability: arbitrary command execution on the client machine processing the malicious repository/submodule. Secondary capability in the included payload: interactive remote shell access for the attacker. This is best classified as a supply-chain style attack vector delivered through a malicious repository/submodule reference, with a network callback payload.LSP1025923 · Disclosed Jul 6, 2026 · bash · markdown · supply_chain · networkOperationalCVE-2023-51385---OpenSSH-ProxyCommand-Injection-PoCThis repository provides a proof-of-concept (PoC) exploit for CVE-2023-51385, a command injection vulnerability in OpenSSH's ProxyCommand option. The exploit demonstrates how an attacker with access to a user's SSH configuration file (~/.ssh/config) or the ability to influence the ProxyCommand option can execute arbitrary shell commands. The provided payload creates a file (/tmp/pwned.txt) with a custom message, proving code execution. The exploit is documented in 'exploit.md' and is intended for educational and authorized penetration testing purposes. The repository contains no executable scripts, but provides clear step-by-step instructions for reproducing the vulnerability on affected OpenSSH versions (prior to 9.8, specifically <9.6). The main attack vector is local, requiring the attacker to modify the user's SSH configuration or command-line arguments.saarcastified · Disclosed Jul 22, 2025 · bash · markdown · localPoC
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
Debian ProjectDebian Linuxoperating_system
OpenbsdOpensshapplication
FAQ

Frequently asked questions

Is CVE-2023-51385 exploited in the wild?
As of Nov 6, 2026, Mallory has no reports of CVE-2023-51385 being exploited in the wild. It is not listed in CISA KEV.
Is there a public exploit for CVE-2023-51385?
Yes. Mallory tracks 2 public exploits or proofs of concept for CVE-2023-51385, the earliest disclosed Jul 22, 2025.
Is there a patch for CVE-2023-51385?
Upgrade OpenSSH to version 9.6 or later, or install the applicable vendor package containing backported fixes. Update affected container images and rebuild dependent images where OpenSSH is embedded.
What products are affected by CVE-2023-51385?
Openbsd Openssh and Debian Project Debian Linux.
How severe is CVE-2023-51385?
CVE-2023-51385 has a CVSS v3.1 score of 6.5 (Medium) and an EPSS score of 19.8% (97th percentile) as of Nov 6, 2026.
Activity feed

Recent activity

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

View more in app →
+9 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 activityCommunity discussion across Reddit, Mastodon, and other social sources.