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.

Advertisement. Scroll to continue reading.

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

Trending

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.

Learn how the LOtL threat landscape has evolved, why traditional endpoint hardening methods fall short, and how adaptive, user-aware approaches can reduce risk.

Watch Now

Join the summit to explore critical threats to public cloud infrastructure, APIs, and identity systems through discussions, case studies, and insights into emerging technologies like AI and LLMs.

Register

People on the Move

Coro, a provider of cybersecurity solutions for SMBs, has appointed Joe Sykora as CEO.

SonicWall has hired Rajnish Mishra as Senior Vice President and Chief Development Officer.

Kenna Security co-founder Ed Bellis has joined Empirical Security as Chief Executive Officer.

More People On The Move

Expert Insights

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest cybersecurity news, threats, and expert insights. Unsubscribe at any time.