CVE-2023-51385 Command injection in n/a

Medium 6.5 Published Updated

OpenSSH allows OS command injection via shell metacharacters in usernames or hostnames referenced by expansion tokens, enabling remote code execution.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2023-51385?

CVE-2023-51385 is a medium-severity command injection vulnerability in Debian Debian Linux, published on 18 Dec 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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.

Weakness: CWE-78

Which versions are affected by CVE-2023-51385?

It affects 2 products.

Linux distribution packages (40)
openssh SUSE:Enterprise Storage 7.1All versions8.4p1-150300.3.30.1
openssh-askpass-gnome SUSE:Enterprise Storage 7.1All versions8.4p1-150300.3.30.1
openssh SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSSAll versions8.1p1-150200.5.46.1
openssh-askpass-gnome SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSSAll versions8.1p1-150200.5.46.1
openssh SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSSAll versions8.4p1-150300.3.30.1
openssh-askpass-gnome SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSSAll versions8.4p1-150300.3.30.1
openssh SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions8.4p1-150300.3.30.1
openssh-askpass-gnome SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions8.4p1-150300.3.30.1
openssh SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions8.4p1-150300.3.30.1
openssh-askpass-gnome SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions8.4p1-150300.3.30.1
openssh SUSE:Linux Enterprise Micro 5.1All versions8.4p1-150300.3.30.1
openssh SUSE:Linux Enterprise Micro 5.2All versions8.4p1-150300.3.30.1
openssh SUSE:Linux Enterprise Micro 5.3All versions8.4p1-150300.3.30.1
openssh SUSE:Linux Enterprise Micro 5.4All versions8.4p1-150300.3.30.1
openssh SUSE:Linux Enterprise Micro 5.5All versions8.4p1-150300.3.30.1
openssh SUSE:Linux Enterprise Module for Basesystem 15 SP5All versions8.4p1-150300.3.30.1
openssh-askpass-gnome SUSE:Linux Enterprise Module for Desktop Applications 15 SP5All versions8.4p1-150300.3.30.1
openssh SUSE:Linux Enterprise Server 12 SP5All versions7.2p2-81.12.1
openssh-askpass-gnome SUSE:Linux Enterprise Server 12 SP5All versions7.2p2-81.12.1
openssh SUSE:Linux Enterprise Server 15 SP2-LTSSAll versions8.1p1-150200.5.46.1
openssh-askpass-gnome SUSE:Linux Enterprise Server 15 SP2-LTSSAll versions8.1p1-150200.5.46.1
openssh SUSE:Linux Enterprise Server 15 SP3-LTSSAll versions8.4p1-150300.3.30.1
openssh-askpass-gnome SUSE:Linux Enterprise Server 15 SP3-LTSSAll versions8.4p1-150300.3.30.1
openssh SUSE:Linux Enterprise Server 15 SP4-LTSSAll versions8.4p1-150300.3.30.1
openssh-askpass-gnome SUSE:Linux Enterprise Server 15 SP4-LTSSAll versions8.4p1-150300.3.30.1
openssh SUSE:Linux Enterprise Server for SAP Applications 12 SP5All versions7.2p2-81.12.1
openssh-askpass-gnome SUSE:Linux Enterprise Server for SAP Applications 12 SP5All versions7.2p2-81.12.1
openssh SUSE:Linux Enterprise Server for SAP Applications 15 SP2All versions8.1p1-150200.5.46.1
openssh-askpass-gnome SUSE:Linux Enterprise Server for SAP Applications 15 SP2All versions8.1p1-150200.5.46.1
openssh SUSE:Linux Enterprise Server for SAP Applications 15 SP3All versions8.4p1-150300.3.30.1
openssh-askpass-gnome SUSE:Linux Enterprise Server for SAP Applications 15 SP3All versions8.4p1-150300.3.30.1
openssh SUSE:Linux Enterprise Server for SAP Applications 15 SP4All versions8.4p1-150300.3.30.1
openssh-askpass-gnome SUSE:Linux Enterprise Server for SAP Applications 15 SP4All versions8.4p1-150300.3.30.1
openssh-testuser SUSE:Linux Enterprise Software Development Kit 12 SP5All versions0-81.12.1
openssh SUSE:Manager Proxy 4.3All versions8.4p1-150300.3.30.1
openssh SUSE:Manager Server 4.3All versions8.4p1-150300.3.30.1
openssh openSUSE:Leap 15.5All versions8.4p1-150300.3.30.1
openssh-askpass-gnome openSUSE:Leap 15.5All versions8.4p1-150300.3.30.1
openssh openSUSE:Leap Micro 5.3All versions8.4p1-150300.3.30.1
openssh openSUSE:Leap Micro 5.4All versions8.4p1-150300.3.30.1

Products include Debian Debian Linux, OpenSSH.

How do I fix CVE-2023-51385?

Upgrade to a fixed version.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2023-51385 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-51385 exists.

Public exploit code: 23 proofs of concept on GitHub.

All Debian Debian Linux vulnerabilities

Sources

Also known as ALPINE-CVE-2023-51385, AZL-32203, AZL-35082, BELL-CVE-2023-51385, CLSA-2023-1703610859, CLSA-2023-1703611900 and 18 more.

Is CVE-2023-51385 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free