CVE-2021-42392 RCE in H2 Console
Attackers can achieve remote code execution via JNDI injection in the H2 database console, requiring immediate patching.
- 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-42392?
CVE-2021-42392 is a critical unsafe deserialization vulnerability in Debian Debian Linux, published on 7 Jan 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
The org.h2.util.JdbcUtils.getConnection method of the H2 database takes as parameters the class name of the driver and URL of the database. An attacker may pass a JNDI driver name and a URL leading to a LDAP or RMI servers, causing remote code execution. This can be exploited through various attack vectors, most notably through the H2 Console which leads to unauthenticated remote code execution.
Weakness: CWE-502
Which versions are affected by CVE-2021-42392?
2 open source packages ship an affected version, including com.h2database:h2. It affects 3 products.
| Package | Affected | Fixed in |
|---|---|---|
com.h2database:h2 Maven | From 1.1.100 | 2.0.206 |
com.h2database:h2 Maven | From 1.1.100 | 2.0.206 |
Products include Debian Debian Linux, H2database H2, Oracle Communications Cloud Native Core Policy.
How do I fix CVE-2021-42392?
Upgrade com.h2database:h2 to 2.0.206 or later.
Upgrade, and only deserialise data from trusted sources or with an allow-list of types. More about Unsafe deserialization.
Is CVE-2021-42392 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-42392 exists.
Public exploit code: 1 Nuclei template and 2 proofs of concept on GitHub.
Other vulnerabilities in Debian Debian Linux
Sources
Also known as CLSA-2026-1787636864, DEBIAN-CVE-2021-42392, GHSA-h376-j262-vhq6, UBUNTU-CVE-2021-42392.