CVE-2023-51385: OS Command Injection in OpenSSH Expansion Tokens
- Vendors
- Debian ProjectOpenbsd
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.
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.
Exploits
2 exploits validated by Mallory's analysis. Hidden: 4 rejected by Mallory's analysis as not a working exploit.
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.
References
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.
Recent activity
17 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.