Remote Code Execution (RCE) The advisory has been revoked - it doesn't affect any version of package com.h2database:h2  (opens in a new tab)


Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
21.51% (97th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Remote Code Execution (RCE) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JAVA-COMH2DATABASE-31685
  • published6 Jun 2018
  • disclosed11 Apr 2018
  • creditCaio Vargas, Matheus Bernardes, Nubank

Introduced: 11 Apr 2018

CVE-2018-10054  (opens in a new tab)
CWE-94  (opens in a new tab)

Amendment

This was deemed not a vulnerability.

Overview

com.h2database:h2 is a database engine

Affected versions of this package are vulnerable to Remote Code Execution (RCE). It provides a web console for managing the database, and by default it does not have a password set. The CREATE ALIAS function calls Java code, allowing an attacker to execute arbitrary Java code on projects running the h2 database.

NOTE: To be remotely exploitable, the affected application must be configured with the non-default setting webAllowOthers=true, either in a config file or as a parameter passed in when the servlet is invoked. The vulnerability can be avoided by setting a password on the database and/or restricting access to localhost using the above setting.

PoC

CREATE ALIAS REVERSE AS $$ String reverse(String s) { return new StringBuilder(s).reverse().toString(); } $$;
CALL REVERSE('Test');