CVE-2021-25641 Dubbo Zookeeper does not check serialization id

Critical 9.8 Published Updated

Remote attackers can force the use of unsafe deserializers like Kryo or FST to achieve code execution if these libraries are present in the classpath.

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

What is CVE-2021-25641?

CVE-2021-25641 is a critical unsafe deserialization vulnerability in Apache Dubbo, published on 29 May 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Each Apache Dubbo server will set a serialization id to tell the clients which serialization protocol it is working on. But for Dubbo versions before 2.7.8 or 2.6.9, an attacker can choose which serialization id the Provider will use by tampering with the byte preamble flags, aka, not following the server's instruction. This means that if a weak deserializer such as the Kryo and FST are somehow in code scope (e.g. if Kryo is somehow a part of a dependency), a remote unauthenticated attacker can tell the Provider to use the weak deserializer, and then proceed to exploit it.

Weakness: CWE-502

Which versions are affected by CVE-2021-25641?

4 open source packages ship an affected version, including org.apache.dubbo:dubbo and com.alibaba:dubbo. It affects 1 product.

PackageAffectedFixed in
org.apache.dubbo:dubbo MavenFrom 2.5.02.7.8
org.apache.dubbo:dubbo MavenFrom 2.5.02.7.8
com.alibaba:dubbo MavenFrom 2.5.02.6.9
com.alibaba:dubbo MavenFrom 2.5.02.6.9

Products include Apache Dubbo.

How do I fix CVE-2021-25641?

Upgrade org.apache.dubbo:dubbo to 2.7.8 or later.

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

Is CVE-2021-25641 being exploited?

There is no known exploitation of CVE-2021-25641 in the wild and no public exploit code.

Public exploit code: 2 proofs of concept on GitHub.

Sources

Also known as GHSA-v2rg-8cwr-75g8.

Is CVE-2021-25641 in your software?

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

Check your SBOMs for free