CVE-2021-25641 Dubbo Zookeeper does not check serialization id
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.
| Package | Affected | Fixed in |
|---|---|---|
org.apache.dubbo:dubbo Maven | From 2.5.0 | 2.7.8 |
org.apache.dubbo:dubbo Maven | From 2.5.0 | 2.7.8 |
com.alibaba:dubbo Maven | From 2.5.0 | 2.6.9 |
com.alibaba:dubbo Maven | From 2.5.0 | 2.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.
Other vulnerabilities in Apache Dubbo
- CVE-2023-29234 Bypass serialize checks in Apache Dubbo
- CVE-2023-46279 Apache Dubbo: Bypass deny serialize list check in Apache Dubbo
- CVE-2021-32824 Regular expression Denial of Service in MooTools
- CVE-2022-39198 Apache Dubbo Hession Deserialization Vulnerability Gadgets Bypass
- CVE-2021-43297 Dubbo Hessian cause RCE when parse error
Sources
Also known as GHSA-v2rg-8cwr-75g8.