CVE-2022-45047: Apache MINA SSHD: Java unsafe deserialization vulnerability
A flaw was found in Apache MINA SSHD, when using Java deserialization to load a serialized java.security.PrivateKey. An attacker could benefit from unsafe deserialization by inserting unsecured data that may affect the application or server.
Other sources
Class org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider in Apache MINA SSHD <= 2.9.1 uses Java deserialization to load a serialized java.security.PrivateKey. The class is one of several implementations that an implementor using Apache MINA SSHD can choose for loading the host keys of an SSH server.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
maven/org.apache.sshd:sshd-coreto a version that resolves this vulnerability.Fixed in 2.9.2 - Upgrade
Upgrade
maven/org.apache.sshd:sshd-commonto a version that resolves this vulnerability.Fixed in 2.9.2 - Upgrade
Upgrade
redhat/jenkinsto a version that resolves this vulnerability.Fixed in 2-plugins-0:4.11.1683009941-1.el8 - Upgrade
Upgrade
redhat/jenkinsto a version that resolves this vulnerability.Fixed in 2-plugins-0:4.12.1675702407-1.el8 - Upgrade
Upgrade
redhat/eap7-apache-sshdto a version that resolves this vulnerability.Fixed in 0:2.9.2-1.redhat_00001.1.el8ea - Upgrade
Upgrade
redhat/eap7-apache-sshdto a version that resolves this vulnerability.Fixed in 0:2.9.2-1.redhat_00001.1.el9ea - Upgrade
Upgrade
redhat/eap7-apache-sshdto a version that resolves this vulnerability.Fixed in 0:2.9.2-1.redhat_00001.1.el7ea - Upgrade
Upgrade
redhat/jenkinsto a version that resolves this vulnerability.Fixed in 2-plugins-0:4.10.1675144701-1.el8 - Upgrade
Upgrade
redhat/jenkinsto a version that resolves this vulnerability.Fixed in 2-plugins-0:4.9.1675668922-1.el8 - Upgrade
Upgrade
redhat/rh-sso7-keycloakto a version that resolves this vulnerability.Fixed in 0:18.0.6-1.redhat_00001.1.el7 - Upgrade
Upgrade
redhat/rh-sso7-keycloakto a version that resolves this vulnerability.Fixed in 0:18.0.6-1.redhat_00001.1.el8 - Upgrade
Upgrade
redhat/rh-sso7-keycloakto a version that resolves this vulnerability.Fixed in 0:18.0.6-1.redhat_00001.1.el9 - Upgrade
Upgrade
redhat/vdsmto a version that resolves this vulnerability.Fixed in 0:4.50.3.6-1.el8e - Upgrade
Upgrade
redhat/apache-sshdto a version that resolves this vulnerability.Fixed in 1:2.9.2-0.1.el8e - Upgrade
Upgrade
redhat/sshdto a version that resolves this vulnerability.Fixed in 2.9.2 - Upgrade
Upgrade
Apache MINA SSHDto a version that resolves this vulnerability.Fixed in 2.9.1 - Configuration
For Apache MINA SSHD <= 2.9.1, do not use org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider to generate and later load your server's host key.
Apache MINA SSHD org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider = do not use (for Apache MINA SSHD <= 2.9.1) - Configuration
Instead of SimpleGeneratorHostKeyProvider, use a custom implementation that uses the OpenSSH format for storing/loading the host key (OpenSSHKeyPairResourceWriter/OpenSSHKeyPairResourceParser), or generate host key files separately (e.g., OpenSSH format) and load them via org.apache.sshd.common.keyprovider.FileKeyPairProvider.
Apache MINA SSHD Host key generation/loading implementation = use a custom implementation (OpenSSH format) or use FileKeyPairProvider with separately generated host keys
Event History
Parent advisories
This vulnerability appears in the following advisories.
Frequently Asked Questions
What is CVE-2022-45047?
CVE-2022-45047 is a vulnerability found in Apache MINA SSHD that allows for arbitrary code execution.
How severe is CVE-2022-45047?
CVE-2022-45047 has a severity rating of critical, with a CVSS score of 9.8.
What is the affected software for CVE-2022-45047?
The affected software for CVE-2022-45047 includes Apache MINA SSHD versions <= 2.9.1, org.apache.sshd:sshd-core version <= 2.1.0, and org.apache.sshd:sshd-common version <= 2.9.2.
How do I fix CVE-2022-45047?
To fix CVE-2022-45047, upgrade to Apache MINA SSHD 2.9.2 or later, org.apache.sshd:sshd-core 2.1.0 or later, or org.apache.sshd:sshd-common 2.9.2 or later.
Where can I find more information about CVE-2022-45047?
You can find more information about CVE-2022-45047 on the NIST NVD website, the Apache MINA SSHD mailing list, and the GitHub commit page.