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.
The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
| Name | Vendor | Start Version | End Version |
|---|---|---|---|
| Openssh | Openbsd | * | 9.6 (excluding) |
| Red Hat Enterprise Linux 8 | RedHat | openssh-0:8.0p1-19.el8_9.2 | * |
| Red Hat Enterprise Linux 8 | RedHat | openssh-0:8.0p1-19.el8_9.2 | * |
| Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support | RedHat | openssh-0:8.0p1-7.el8_4.2 | * |
| Red Hat Enterprise Linux 8.4 Extended Update Support Long-Life Add-On | RedHat | openssh-0:8.0p1-7.el8_4.2 | * |
| Red Hat Enterprise Linux 8.6 Extended Update Support | RedHat | openssh-0:8.0p1-15.el8_6.3 | * |
| Red Hat Enterprise Linux 8.8 Extended Update Support | RedHat | openssh-0:8.0p1-19.el8_8.2 | * |
| Red Hat Enterprise Linux 9 | RedHat | openssh-0:8.7p1-34.el9_3.3 | * |
| Red Hat Enterprise Linux 9 | RedHat | openssh-0:8.7p1-34.el9_3.3 | * |
| Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions | RedHat | openssh-0:8.7p1-13.el9_0.1 | * |
| Red Hat Enterprise Linux 9.2 Extended Update Support | RedHat | openssh-0:8.7p1-30.el9_2.3 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/cephcsi-rhel9:v4.15.0-37 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/mcg-core-rhel9:v4.15.0-68 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/mcg-operator-bundle:v4.15.0-158 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/mcg-rhel9-operator:v4.15.0-39 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/ocs-client-console-rhel9:v4.15.0-58 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/ocs-client-operator-bundle:v4.15.0-158 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/ocs-client-rhel9-operator:v4.15.0-13 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/ocs-metrics-exporter-rhel9:v4.15.0-81 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/ocs-operator-bundle:v4.15.0-158 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/ocs-rhel9-operator:v4.15.0-79 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/odf-cli-rhel9:v4.15.0-22 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/odf-console-rhel9:v4.15.0-57 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/odf-cosi-sidecar-rhel9:v4.15.0-6 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/odf-csi-addons-operator-bundle:v4.15.0-158 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/odf-csi-addons-rhel9-operator:v4.15.0-15 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/odf-csi-addons-sidecar-rhel9:v4.15.0-15 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/odf-multicluster-console-rhel9:v4.15.0-54 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/odf-multicluster-operator-bundle:v4.15.0-158 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/odf-multicluster-rhel9-operator:v4.15.0-10 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/odf-must-gather-rhel9:v4.15.0-26 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/odf-operator-bundle:v4.15.0-158 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/odf-rhel9-operator:v4.15.0-19 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/odr-cluster-operator-bundle:v4.15.0-158 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/odr-hub-operator-bundle:v4.15.0-158 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/odr-rhel9-operator:v4.15.0-21 | * |
| RHODF-4.15-RHEL-9 | RedHat | odf4/rook-ceph-rhel9-operator:v4.15.0-103 | * |
| Openssh | Ubuntu | bionic | * |
| Openssh | Ubuntu | devel | * |
| Openssh | Ubuntu | esm-infra-legacy/trusty | * |
| Openssh | Ubuntu | esm-infra-legacy/xenial | * |
| Openssh | Ubuntu | esm-infra/bionic | * |
| Openssh | Ubuntu | esm-infra/focal | * |
| Openssh | Ubuntu | esm-infra/xenial | * |
| Openssh | Ubuntu | fips-preview/jammy | * |
| Openssh | Ubuntu | fips-updates/bionic | * |
| Openssh | Ubuntu | fips-updates/focal | * |
| Openssh | Ubuntu | fips-updates/jammy | * |
| Openssh | Ubuntu | fips-updates/xenial | * |
| Openssh | Ubuntu | fips/bionic | * |
| Openssh | Ubuntu | fips/focal | * |
| Openssh | Ubuntu | fips/xenial | * |
| Openssh | Ubuntu | focal | * |
| Openssh | Ubuntu | jammy | * |
| Openssh | Ubuntu | lunar | * |
| Openssh | Ubuntu | mantic | * |
| Openssh | Ubuntu | noble | * |
| Openssh | Ubuntu | oracular | * |
| Openssh | Ubuntu | plucky | * |
| Openssh | Ubuntu | questing | * |
| Openssh | Ubuntu | resolute | * |
| Openssh | Ubuntu | trusty | * |
| Openssh | Ubuntu | trusty/esm | * |
| Openssh | Ubuntu | upstream | * |
| Openssh | Ubuntu | xenial | * |
| Openssh-ssh1 | Ubuntu | bionic | * |
| Openssh-ssh1 | Ubuntu | devel | * |
| Openssh-ssh1 | Ubuntu | esm-apps/bionic | * |
| Openssh-ssh1 | Ubuntu | esm-apps/focal | * |
| Openssh-ssh1 | Ubuntu | esm-apps/jammy | * |
| Openssh-ssh1 | Ubuntu | esm-apps/noble | * |
| Openssh-ssh1 | Ubuntu | esm-apps/resolute | * |
| Openssh-ssh1 | Ubuntu | focal | * |
| Openssh-ssh1 | Ubuntu | jammy | * |
| Openssh-ssh1 | Ubuntu | lunar | * |
| Openssh-ssh1 | Ubuntu | mantic | * |
| Openssh-ssh1 | Ubuntu | noble | * |
| Openssh-ssh1 | Ubuntu | oracular | * |
| Openssh-ssh1 | Ubuntu | plucky | * |
| Openssh-ssh1 | Ubuntu | questing | * |
| Openssh-ssh1 | Ubuntu | resolute | * |
| Openssh-ssh1 | Ubuntu | upstream | * |
This weakness can lead to a vulnerability in environments in which the attacker does not have direct access to the operating system, such as in web applications. Alternately, if the weakness occurs in a privileged program, it could allow the attacker to specify commands that normally would not be accessible, or to call alternate commands with privileges that the attacker does not have. The problem is exacerbated if the compromised process does not follow the principle of least privilege, because the attacker-controlled commands may run with special system privileges that increases the amount of damage. There are at least two subtypes of OS command injection:
From a weakness standpoint, these variants represent distinct programmer errors. In the first variant, the programmer clearly intends that input from untrusted parties will be part of the arguments in the command to be executed. In the second variant, the programmer does not intend for the command to be accessible to any untrusted party, but the programmer probably has not accounted for alternate ways in which malicious attackers can provide input.