H2O-3 is Vulnerable to Code Injection
The H2O-3 REST API endpoint for importing SQL tables used a blacklist that only blocked dangerous MySQL JDBC parameters. An unauthenticated attacker could switch the JDBC URL to PostgreSQL and use PostgreSQL-specific parameters to execute arbitrary code on the server.
h2oai/h2o-3
Originally disclosed on huntr
A critical remote code execution vulnerability exists in the unauthenticated REST API endpoint /99/ImportSQLTable in H2O-3 version 3.46.0.9 and prior. The vulnerability arises due to insufficient security controls in the parameter blacklist mechanism, which only targets MySQL JDBC driver-specific dangerous parameters. An attacker can bypass these controls by switching the JDBC URL protocol to jdbc:postgresql: and exploiting PostgreSQL JDBC driver-specific parameters such as socketFactory and socketFactoryArg. This allows unauthenticated attackers to execute arbitrary code on the H2O-3 server with the privileges of the H2O-3 process. The issue is resolved in version 3.46.0.10.
From the GitHub Advisory Database (GHSA-qmcv-hh7c-3m56, CC BY 4.0).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The parameter blacklist was incomplete because it only covered MySQL JDBC driver parameters and did not account for equivalent dangerous parameters in other JDBC drivers such as PostgreSQL.
Impact
Unauthenticated attackers could execute arbitrary code on the H2O-3 server with the privileges of the H2O-3 process.
What the attacker needed
Network access to the H2O-3 REST API; no authentication required
The fix
The issue was fixed in version 3.46.0.10.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
H2O-3 is a machine-learning server that lets users connect to databases. It tried to block dangerous database connection settings, but only for one type of database (MySQL). By pretending to connect to a different database (PostgreSQL), an attacker could sneak in settings that make the server run their own commands.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.