---
id: CVE-2023-51385
title: >-
  In ssh in OpenSSH before 9.6, OS command injection might occur if a user name
  or host name has shell metacharacters, and this name is referenced by an
  expansion token in certain situations
summary: >-
  In ssh in OpenSSH before 9.6, OS command injection might occur if a user name
  or host name has shell metacharacters, and this name is referenced by an
  expansion token in certain situations. For example, an untrusted Git
  repository can ha…
severity: medium
cvss: 6.5
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N'
cwe:
  - CWE-78
vendor: openbsd
product: openssh
affected:
  - openssh < 9.6
  - debian_linux = 10.0
  - debian_linux = 11.0
  - debian_linux = 12.0
patched:
  - openssh 9.6
published: '2023-12-18'
updated: '2026-10-15'
sourceUpdated: '2026-10-15T01:17:12.563'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2023-51385'
references:
  - url: 'http://seclists.org/fulldisclosure/2024/Mar/21'
    label: cve@mitre.org
  - url: 'http://www.openwall.com/lists/oss-security/2023/12/26/4'
    label: cve@mitre.org
  - url: >-
      https://github.com/openssh/openssh-portable/commit/7ef3787c84b6b524501211b11a26c742f829af1a
    label: cve@mitre.org
  - url: 'https://lists.debian.org/debian-lts-announce/2023/12/msg00017.html'
    label: cve@mitre.org
  - url: 'https://security.gentoo.org/glsa/202312-17'
    label: cve@mitre.org
  - url: 'https://security.netapp.com/advisory/ntap-20240105-0005/'
    label: cve@mitre.org
  - url: 'https://support.apple.com/kb/HT214084'
    label: cve@mitre.org
  - url: >-
      https://vin01.github.io/piptagole/ssh/security/openssh/libssh/remote-code-execution/2023/12/20/openssh-proxycommand-libssh-rce.html
    label: cve@mitre.org
  - url: 'https://www.debian.org/security/2023/dsa-5586'
    label: cve@mitre.org
  - url: 'https://www.openssh.com/txt/release-9.6'
    label: cve@mitre.org
  - url: 'https://www.openwall.com/lists/oss-security/2023/12/18/2'
    label: cve@mitre.org
  - url: 'http://seclists.org/fulldisclosure/2024/Mar/21'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: 'http://www.openwall.com/lists/oss-security/2023/12/26/4'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: 'http://www.openwall.com/lists/oss-security/2025/10/07/1'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: 'http://www.openwall.com/lists/oss-security/2025/10/12/1'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: >-
      https://github.com/openssh/openssh-portable/commit/7ef3787c84b6b524501211b11a26c742f829af1a
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: 'https://lists.debian.org/debian-lts-announce/2023/12/msg00017.html'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: 'https://security.gentoo.org/glsa/202312-17'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: 'https://security.netapp.com/advisory/ntap-20240105-0005/'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: 'https://support.apple.com/kb/HT214084'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: >-
      https://vin01.github.io/piptagole/ssh/security/openssh/libssh/remote-code-execution/2023/12/20/openssh-proxycommand-libssh-rce.html
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: 'https://www.debian.org/security/2023/dsa-5586'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: 'https://www.openssh.com/txt/release-9.6'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: 'https://www.openwall.com/lists/oss-security/2023/12/18/2'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: 'https://cert-portal.siemens.com/productcert/html/ssa-082556.html'
    label: 0b142b55-0307-4c5a-b3c9-f314f3fb7c5e
  - url: 'https://cert-portal.siemens.com/productcert/html/ssa-769027.html'
    label: 0b142b55-0307-4c5a-b3c9-f314f3fb7c5e
  - url: 'https://cert-portal.siemens.com/productcert/html/ssa-794697.html'
    label: 0b142b55-0307-4c5a-b3c9-f314f3fb7c5e
tags:
  - nvd
  - exploit-available
  - cve.org
epss: 0.19753
epssPercentile: 0.97369
exploits:
  github: 23
  githubRepos:
    - 'https://github.com/vin01/poc-proxycommand-vulnerable'
    - 'https://github.com/FeatherStark/CVE-2023-51385'
    - 'https://github.com/watarium/poc-cve-2023-51385'
  checkedAt: '2026-10-15T03:30:48.732Z'
exploitAvailable: true
ingestedAt: '2026-10-15T03:30:12.633Z'
ssvc:
  exploitation: poc
  automatable: 'yes'
  technicalImpact: total
  timestamp: '2025-08-15T14:20:00.630258Z'
---

## Overview

In ssh in OpenSSH before 9.6, OS command injection might occur if a user name or host name has shell metacharacters, and this name is referenced by an expansion token in certain situations. For example, an untrusted Git repository can have a submodule with shell metacharacters in a user name or host name.

## Affected

- `openssh < 9.6`
- `debian_linux = 10.0`
- `debian_linux = 11.0`
- `debian_linux = 12.0`

## Remediation

Upgrade past the affected range:

- `openssh 9.6`
