CVE-2022-45047 Apache MINA SSHD: Java unsafe deserialization vulnerability

Critical 9.8 Published Updated

An attacker can execute arbitrary code if a developer uses the SimpleGeneratorHostKeyProvider class to load host keys via Java deserialization.

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

What is CVE-2022-45047?

CVE-2022-45047 is a critical unsafe deserialization vulnerability in Apache MINA SSHD, published on 16 Nov 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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.

Weakness: CWE-502

Which versions are affected by CVE-2022-45047?

4 open source packages ship an affected version, including org.apache.sshd:sshd-common and org.apache.sshd:sshd-core. It affects 1 product.

PackageAffectedFixed in
org.apache.sshd:sshd-common MavenAll versions2.9.2
org.apache.sshd:sshd-common MavenAll versions2.9.2
org.apache.sshd:sshd-core MavenAll versions2.9.2
org.apache.sshd:sshd-core MavenAll versions2.9.2
Linux distribution packages (1)
apache-sshd openSUSE:TumbleweedAll versions2.9.2-1.1

Products include Apache Sshd.

How do I fix CVE-2022-45047?

Upgrade org.apache.sshd:sshd-common to 2.9.2 or later.

Upgrade, and only deserialise data from trusted sources or with an allow-list of types. More about Unsafe deserialization.

Is CVE-2022-45047 being exploited?

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

Public exploit code: 1 proofs of concept on GitHub.

Sources

Also known as GHSA-fhw8-8j55-vwgq, MINI-c6p5-qw5r-fm4x, OESA-2022-2119, openSUSE-SU-2024:12511-1.

Is CVE-2022-45047 in your software?

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

Check your SBOMs for free