Security Experts:

Connect with us

Hi, what are you looking for?

SecurityWeekSecurityWeek

Vulnerabilities

Log4Shell-Like Vulnerability Found in Popular H2 Database

A critical, unauthenticated remote code execution vulnerability has been impacting the H2 database console since 2008.

An open-source Java SQL database, H2 is an in-memory solution that eliminates the need to store data on disk, and is one of the most popular Maven packages, having roughly 7,000 artifact dependencies,

A critical, unauthenticated remote code execution vulnerability has been impacting the H2 database console since 2008.

An open-source Java SQL database, H2 is an in-memory solution that eliminates the need to store data on disk, and is one of the most popular Maven packages, having roughly 7,000 artifact dependencies,

Tracked as CVE-2021-42392, the newly disclosed vulnerability has been lurking in H2 since version 1.1.100, which was released in 2008. All versions through 2.0.204 (released in December 2021) are affected.

The new bug, JFrog says, has the same root cause as the famous Log4Shell bug – they both involve the Java Naming and Directory Interface (JNDI) lookup feature – yet its impact isn’t as widespread, mainly because the console isn’t always used with the H2 database and because the H2 console listens to localhost by default.

However, the severity of the issue becomes critical when the H2 console is exposed to the LAN or WAN, given that it could be exploited to execute code remotely, without authentication.

“H2 Console doesn’t accept remote connections by default. If remote access was enabled explicitly and some protection method (such as security constraint) wasn’t set, an intruder can load own custom class and execute its code in a process with H2 Console (H2 Server process or a web server with H2 Console servlet),” the H2 maintainers explain.

The issue exists because unfiltered attacker-controlled URLs are passed to a lookup function, which essentially allows for the injection of Java code remotely, thus leading to RCE.

JFrog’s security researchers, who identified the vulnerability, explain that the most severe of the possible attack vectors is through the H2 console itself, mainly because one can use public search tools to locate WAN-facing vulnerable consoles.

The researchers also identified a series of SQL-based attack vectors, some requiring authentication with high privileges, such as those of an administrator. The built-in H2 shell can also be leveraged as an attack vector, though the scenario is highly unlikely, JFrog says.

The vulnerability was addressed with the release of H2 database version 2.0.206 and all those who use the H2 console are advised to upgrade to this release as soon as possible.

“Since version 2.0.206 H2 Console and linked tables explicitly forbid attempts to specify LDAP URLs for JNDI. Only local data sources can be used,” the H2 maintainers explain.

Related: ICS Vendors Respond to Log4j Vulnerabilities

Related: New Google Tool Helps Developers Visualize Dependencies of Open Source Projects

Related: GitHub Patches Security Flaws in Core Node.js Dependencies

Written By

Ionut Arghire is an international correspondent for SecurityWeek.

Click to comment

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest threats, trends, and technology, along with insightful columns from industry experts.

Join this webinar to learn best practices that organizations can use to improve both their resilience to new threats and their response times to incidents.

Register

Join this live webinar as we explore the potential security threats that can arise when third parties are granted access to a sensitive data or systems.

Register

Expert Insights

Related Content

Vulnerabilities

Less than a week after announcing that it would suspended service indefinitely due to a conflict with an (at the time) unnamed security researcher...

Application Security

Drupal released updates that resolve four vulnerabilities in Drupal core and three plugins.

Risk Management

The supply chain threat is directly linked to attack surface management, but the supply chain must be known and understood before it can be...

Vulnerabilities

Apple has released updates for macOS, iOS and Safari and they all include a WebKit patch for a zero-day vulnerability tracked as CVE-2023-23529.

Cloud Security

VMware vRealize Log Insight vulnerability allows an unauthenticated attacker to take full control of a target system.

Application Security

A CSRF vulnerability in the source control management (SCM) service Kudu could be exploited to achieve remote code execution in multiple Azure services.

IoT Security

Lexmark warns of a remote code execution (RCE) vulnerability impacting over 120 printer models, for which PoC code has been published.

Vulnerabilities

GoAnywhere MFT users warned about a zero-day remote code injection exploit that can be targeted directly from the internet