Remote Code Execution Vulnerability in H2Database: CVE-2021-42392

h2database Updated 02 Oct 2025

Summary

10/01/2022
N/A
Yes i
Unrated
Not published

DEBIAN-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. Affects h2database versions < 1.4.197-4+deb11u1. Fixed in 1.4.197-4+deb11u1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

H2Database is a popular open-source relational database management system written in Java. It is known for its lightweight nature, ease of use, and ability to run in embedded or server modes. The database supports various features like in-memory databases, JDBC API, and SQL compatibility. However, it has been identified to have a critical vulnerability that allows remote code execution, posing a significant risk to applications that utilize it.

Vulnerability Detail

The vulnerability, identified as CVE-2021-42392, arises from the org.h2.util.JdbcUtils.getConnection method, which accepts a driver class name and a database URL. An attacker can exploit this by providing a JNDI driver name and a URL that points to an LDAP or RMI server, enabling remote code execution. This vulnerability can be exploited through various attack vectors, particularly through the H2 Console, leading to unauthenticated remote code execution. The potential ramifications include unauthorized access to sensitive data, system compromise, and the ability to execute arbitrary code on the server.

How To Fix

Minimum fixed version

1.4.197-4+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade h2database

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, consider disabling the H2 Console or restricting access to it to trusted users only. Additionally, avoid using JNDI driver names and URLs that could lead to external servers.

Conclusion

CVE-2021-42392 represents a serious security risk for applications using H2Database. It is essential to update to the latest patched versions to protect against potential exploits. Additionally, utilizing tools like Vulert can help monitor for vulnerabilities in your software.

See every vulnerability recorded for h2database →

Share this vulnerability

FAQ

CVE-2021-42392 is a vulnerability in H2Database that allows remote code execution through the JdbcUtils.getConnection method.

You can check if your application is affected by using Vulert, which monitors open-source vulnerabilities in real-time. Visit Vulert Scanner to analyze your manifest file.

The risks include unauthorized access to sensitive data, system compromise, and execution of arbitrary code on the server.

Yes, patches are available for various Debian versions. Ensure you update to the specified patched versions to mitigate the risk.

If immediate updates are not possible, consider disabling the H2 Console and restricting access to it as a temporary measure.

Related vulnerabilities

Recent vulnerabilities recorded for h2database.

How To Fix

Minimum fixed version

1.4.197-4+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade h2database

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback