Remote Code Execution via JNDI Injection in H2 Database's getConnection Method

Remote Code Execution via JNDI Injection in H2 Database's getConnection Method

CVE-2021-42392 · CRITICAL Severity

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

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.

Learn more about our Cis Benchmark Audit For Server Software.