cve.bz

CVE-2023-51385 OS Command Injection

6.5 mediumEPSS 20%Fix available

Medium (6.5). EPSS 20% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 3.1

6.5 medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
EPSS
20% (unchanged from 20% a week ago; 20% 30 days ago) estimated probability of exploitation activity in the next 30 days; 97th percentile. Scored 2026-11-17. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: PoC · Automatable: yes · Technical impact: total, assessed 2025-08-15. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-78 Improper Neutralization of Special Elements used in an OS Command (OS Command Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2023-51385 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2023-51385?via=ask-ai-copy and https://cve.bz/cve/CVE-2023-51385?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2023-51385 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
openbsd:opensshbefore 9.6
debian:debian_linux10.0
debian:debian_linux11.0
debian:debian_linux12.0

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian10openssh1:7.9p1-10+deb10u4DLA-3694-1
Debian11openssh1:8.4p1-5+deb11u3DSA-5586-1
Debian12openssh1:9.2p1-2+deb12u2DEBIAN-CVE-2023-51385 DSA-5586-1
Debian13, 14openssh1:9.6p1-1DEBIAN-CVE-2023-51385
Ubuntu18.04:LTS, 20.04:LTS, 22.04:LTS and 4 moreopenssh-ssh1no fix listedUBUNTU-CVE-2023-51385
Ubuntu20.04:LTSopenssh1:8.2p1-4ubuntu0.11UBUNTU-CVE-2023-51385 USN-6565-1
Ubuntu22.04:LTSopenssh1:8.9p1-3ubuntu0.6UBUNTU-CVE-2023-51385 USN-6565-1
Ubuntu24.04:LTSopenssh1:9.6p1-3ubuntu1UBUNTU-CVE-2023-51385
UbuntuPro:14.04:LTS, Pro:FIPS:16.04:LTS, Pro:FIPS:18.04:LTS and 1 moreopensshno fix listedUBUNTU-CVE-2023-51385
UbuntuPro:16.04:LTSopenssh1:7.2p2-4ubuntu2.10+esm6UBUNTU-CVE-2023-51385 USN-6560-2 USN-6560-3
UbuntuPro:18.04:LTSopenssh1:7.6p1-4ubuntu0.7+esm3UBUNTU-CVE-2023-51385 USN-6560-2
UbuntuPro:FIPS-updates:16.04:LTSopenssh1:7.2p2-4ubuntu2.fips.2.10.6UBUNTU-CVE-2023-51385
UbuntuPro:FIPS-updates:18.04:LTSopenssh1:7.9p1-10~ubuntu18.04.fips.0.9UBUNTU-CVE-2023-51385
UbuntuPro:FIPS-updates:20.04:LTSopenssh1:8.2p1-4ubuntu0.fips.0.11UBUNTU-CVE-2023-51385
Red Hatenterprise_linux:8::appstreamopenssh-askpass, openssh-debuginfo, openssh-debugsource and 6 more0:8.0p1-19.el8_9.2RHSA-2024:0606
Red Hatenterprise_linux:8::appstreampam_ssh_agent_auth-debuginfo0:0.10.3-7.19.el8_9.2RHSA-2024:0606
Red Hatenterprise_linux:8::baseosopenssh, openssh-cavs, openssh-ldap and 11 more0:8.0p1-19.el8_9.2RHSA-2024:0606
Red Hatenterprise_linux:8::baseospam_ssh_agent_auth, pam_ssh_agent_auth-debuginfo0:0.10.3-7.19.el8_9.2RHSA-2024:0606
Red Hatenterprise_linux:9::appstreamopenssh-askpass, openssh-debuginfo, openssh-debugsource and 5 more0:8.7p1-34.el9_3.3RHSA-2024:1130
Red Hatenterprise_linux:9::appstreampam_ssh_agent_auth, pam_ssh_agent_auth-debuginfo0:0.10.4-5.34.el9_3.3RHSA-2024:1130
Red Hatenterprise_linux:9::baseosopenssh, openssh-keycat, openssh-server and 8 more0:8.7p1-34.el9_3.3RHSA-2024:1130
Red Hatenterprise_linux:9::baseospam_ssh_agent_auth-debuginfo0:0.10.4-5.34.el9_3.3RHSA-2024:1130
Red Hatrhel_aus:8.4::baseos, rhel_eus_long_life:8.4::baseosopenssh, openssh-server, openssh-clients0:8.0p1-7.el8_4.2RHSA-2026:22329
Red Hatrhel_e4s:9.0::appstreamopenssh-askpass, openssh-debuginfo, openssh-debugsource and 4 more0:8.7p1-13.el9_0.1RHSA-2026:1790
Red Hatrhel_e4s:9.0::appstreampam_ssh_agent_auth, pam_ssh_agent_auth-debuginfo0:0.10.4-4.13.el9_0.4RHSA-2026:1790
Red Hatrhel_e4s:9.0::baseosopenssh, openssh-keycat, openssh-server and 7 more0:8.7p1-13.el9_0.1RHSA-2026:1790
13 more for Red Hat in the JSON and on Red Hat's page.
SUSEEnterprise Storage 7.1, Linux Enterprise High Performance Computing 15 SP3-LTSS, Linux Enterprise High Performance Computing 15 SP4-ESPOS and 5 moreopenssh, openssh-askpass-gnome8.4p1-150300.3.30.1SUSE-SU-2024:0596-1
SUSELinux Enterprise High Performance Computing 15 SP2-LTSS, Linux Enterprise Server 15 SP2-LTSS, Linux Enterprise Server for SAP Applications 15 SP2openssh, openssh-askpass-gnome8.1p1-150200.5.46.1SUSE-SU-2024:0603-1
SUSELinux Enterprise Micro 5.1, Linux Enterprise Micro 5.2, Linux Enterprise Micro 5.3 and 5 moreopenssh8.4p1-150300.3.30.1SUSE-SU-2024:0596-1
SUSELinux Enterprise Module for Basesystem 15 SP6openssh9.6p1-150600.6.6.1SUSE-SU-2024:2393-1
SUSELinux Enterprise Module for Desktop Applications 15 SP5openssh-askpass-gnome8.4p1-150300.3.30.1SUSE-SU-2024:0596-1
SUSELinux Enterprise Module for Desktop Applications 15 SP6openssh-askpass-gnome9.6p1-150600.6.6.1SUSE-SU-2024:2393-1
SUSELinux Enterprise Server 12 SP5, Linux Enterprise Server for SAP Applications 12 SP5openssh, openssh-askpass-gnome7.2p2-81.12.1SUSE-SU-2024:0604-1
SUSELinux Enterprise Software Development Kit 12 SP5openssh-testuser0-81.12.1SUSE-SU-2024:0604-1
SUSELinux Micro 6.0openssh9.6p1-2.1SUSE-SU-2025:20009-1
openSUSELeap 15.5openssh, openssh-askpass-gnome8.4p1-150300.3.30.1SUSE-SU-2024:0596-1
openSUSELeap 15.6openssh, openssh-askpass-gnome9.6p1-150600.6.6.1SUSE-SU-2024:2393-1
openSUSELeap Micro 5.3, Leap Micro 5.4openssh8.4p1-150300.3.30.1SUSE-SU-2024:0596-1
openSUSETumbleweedopenssh9.6p1-11.1openSUSE-SU-2024:14113-1
AlmaLinux8openssh, openssh-cavs, openssh-ldap and 4 more8.0p1-19.el8_9.2ALSA-2024:0606
AlmaLinux8pam_ssh_agent_auth0.10.3-7.19.el8_9.2ALSA-2024:0606
AlmaLinux9openssh, openssh-keycat, openssh-server and 2 more8.7p1-34.el9_3.3ALSA-2024:1130
AlmaLinux9pam_ssh_agent_auth0.10.4-5.34.el9_3.3ALSA-2024:1130
Rocky Linux8openssh0:8.0p1-19.el8_9.2RLSA-2024:0606
Alpinev3.16openssh9.0_p1-r5ALPINE-CVE-2023-51385
Alpinev3.17openssh9.1_p1-r5ALPINE-CVE-2023-51385
Alpinev3.19, v3.20, v3.21 and 3 moreopenssh9.6_p1-r0ALPINE-CVE-2023-51385
Azure Linux2openssh8.9p1-3AZL-32203
Azure Linux3openssh9.7p1-1AZL-35082
Alpaquita23openssh9.1_p1-r7BELL-CVE-2023-51385
Alpaquitastreamopenssh9.6_p1-r0BELL-CVE-2023-51385
BellSoft Hardened Containers23openssh9.1_p1-r7BELL-CVE-2023-51385
BellSoft Hardened Containersstreamopenssh9.6_p1-r0BELL-CVE-2023-51385

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause; the Alpine secdb, CC BY-SA 4.0; Microsoft's Azure Linux vulnerability data, MIT; BellSoft's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine · Alpaquita · BellSoft Hardened Containers.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

The ability to execute OS commands is dependent on what quoting is present in the user-supplied ssh_config directive. However, it is generally the user's responsibility to validate arguments passed to SSH.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 8openssh-0:8.0p1-19.el8_9.2Fixed 2024-01-30RHSA-2024:0606
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Supportopenssh-0:8.0p1-7.el8_4.2Fixed 2026-06-01RHSA-2026:22329
Red Hat Enterprise Linux 8.4 Extended Update Support Long-Life Add-Onopenssh-0:8.0p1-7.el8_4.2Fixed 2026-06-01RHSA-2026:22329
Red Hat Enterprise Linux 8.6 Extended Update Supportopenssh-0:8.0p1-15.el8_6.3Fixed 2024-01-25RHSA-2024:0429
Red Hat Enterprise Linux 8.8 Extended Update Supportopenssh-0:8.0p1-19.el8_8.2Fixed 2024-01-30RHSA-2024:0594
Red Hat Enterprise Linux 9openssh-0:8.7p1-34.el9_3.3Fixed 2024-03-05RHSA-2024:1130
Red Hat Enterprise Linux 9.0 Update Services for SAP Solutionsopenssh-0:8.7p1-13.el9_0.1Fixed 2026-02-03RHSA-2026:1790
Red Hat Enterprise Linux 9.2 Extended Update Supportopenssh-0:8.7p1-30.el9_2.3Fixed 2024-01-25RHSA-2024:0455
RHODF-4.15-RHEL-9odf4/cephcsi-rhel9:v4.15.0-37Fixed 2024-03-19RHSA-2024:1383
RHODF-4.15-RHEL-9odf4/mcg-core-rhel9:v4.15.0-68Fixed 2024-03-19RHSA-2024:1383
RHODF-4.15-RHEL-9odf4/mcg-operator-bundle:v4.15.0-158Fixed 2024-03-19RHSA-2024:1383
RHODF-4.15-RHEL-9odf4/mcg-rhel9-operator:v4.15.0-39Fixed 2024-03-19RHSA-2024:1383
RHODF-4.15-RHEL-9odf4/ocs-client-console-rhel9:v4.15.0-58Fixed 2024-03-19RHSA-2024:1383
RHODF-4.15-RHEL-9odf4/ocs-client-operator-bundle:v4.15.0-158Fixed 2024-03-19RHSA-2024:1383
RHODF-4.15-RHEL-9odf4/ocs-client-rhel9-operator:v4.15.0-13Fixed 2024-03-19RHSA-2024:1383
RHODF-4.15-RHEL-9odf4/ocs-metrics-exporter-rhel9:v4.15.0-81Fixed 2024-03-19RHSA-2024:1383
RHODF-4.15-RHEL-9odf4/ocs-operator-bundle:v4.15.0-158Fixed 2024-03-19RHSA-2024:1383
RHODF-4.15-RHEL-9odf4/ocs-rhel9-operator:v4.15.0-79Fixed 2024-03-19RHSA-2024:1383
Red Hat Enterprise Linux 6opensshOut of support scope
Red Hat Enterprise Linux 7opensshOut of support scope
16 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2023-51385.

ICS advisories (CISA)

AdvisoryTitlePublishedSectorsAffectedFixed
ICSA-25-162-05Siemens SIMATIC S7-1500 CPU family2025-06-10EnergySIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AB0), SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AC0), SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AB0) and 2 morenone listed
ICSA-25-044-09Siemens SCALANCE W700 IEEE 802.11ax2025-02-11Chemical, Critical Manufacturing, Energy, Food and Agriculture, Water and Wastewater SystemsSCALANCE WAB762-1 (6GK5762-1AJ00-6AA0), SCALANCE WAM763-1 (6GK5763-1AL00-7DA0), SCALANCE WAM763-1 (ME) (6GK5763-1AL00-7DC0) and 16 morenone listed
ICSA-23-166-11Siemens SIMATIC S7-1500 TM MFP Linux Kernel2023-06-13MultipleSIMATIC S7-1500 TM MFP - GNU/Linux subsystemnone listed

From CISA's ICS advisories (CSAF), provided under CISA's notification. Only the facts are shown; each advisory is on CISA's page. Credits.

GitHub PoC

Repositories on GitHub named after this CVE or listed for it by the PoC-in-GitHub index. For those marked Harbor Check: matches CVE, Flawharbor read the code and found it implements this CVE's exploitation technique: read, not run, and its dependencies only checked for warning signs, so a pointer and no guarantee. The rest are unverified: some hold a working proof of concept, some nothing useful, and some malware made to look like one. Read the code before you run any of it. How Harbor Check reads them, and what it found.

Attack patterns (CAPEC)

  • CAPEC-6 Argument Injection Likelihood: High · Severity: High
  • CAPEC-15 Command Delimiters Likelihood: High · Severity: High
  • CAPEC-43 Exploiting Multiple Input Interpretation Layers Likelihood: Medium · Severity: High
  • CAPEC-88 OS Command Injection Likelihood: High · Severity: High
  • CAPEC-108 Command Line Execution through SQL Injection Likelihood: Low · Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON