H2O.ai remote code execution via unrestricted JDBC connection
H2O.ai H2O version 3.46.0.4 contains an unauthenticated remote code execution vulnerability in the ImportSQLTable endpoint that allows attackers to arbitrarily set JDBC connection URLs, leading to deserialization attacks and command execution on the victim's server.
What happened
H2O version 3.46.0.4 contains an unauthenticated remote code execution vulnerability in the ImportSQLTable endpoint. Despite using a getConnectionSafe method intended to establish secure connections, no restrictions are placed on JDBC connection settings, allowing attackers to arbitrarily set the JDBC URL.
An attacker can exploit this by posting a JSON document to the /99/ImportSQLTable endpoint with a connection_url property containing a malicious JDBC connection URL. This can trigger deserialization attacks via queryInterceptors or similar mechanisms in JDBC drivers such as MySQL, PostgreSQL, Derby, and H2O's own H2 driver.
Reported impact
The vulnerability enables remote code execution on the victim's server through deserialization of malicious objects, file reads, and command execution. An attacker with network access to the ImportSQLTable endpoint can achieve arbitrary command execution.
Index analysis
The vulnerability stems from unrestricted JDBC URL configuration in the getConnectionSafe method. The code fails to validate or restrict which JDBC drivers or URLs can be used, allowing attackers to point connections to malicious servers that trigger deserialization vulnerabilities inherent in various JDBC client libraries.
Classification
Sources and evidence
This record was researched and written by the Index, based on the following original reporting.