Advisory: Metabase Pre-Auth RCE (CVE-2023-38646)
An unauthenticated attacker can obtain the setup token for a Metabase instance and use it to reach an endpoint that validates an H2 database connection, where the H2 JDBC driver allows remote code execution. This lets the attacker execute arbitrary Java code and commands on the server.
blog.assetnote.io
Published on blog.assetnote.io
An unauthenticated attacker can obtain the setup token for an instance and use it to achieve remote code execution via an endpoint that allows you to validate a H2 database connection. When validating the database, the H2 JDBC driver allows for the attacker to achieve RCE.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the setup token was exposed to unauthenticated users and the database connection validation endpoint passed attacker-controlled JDBC parameters to the H2 driver, which supports code execution.
Impact
An attacker could execute arbitrary Java code and commands on the server.
What the attacker needed
Unauthenticated access to the instance
The fix
The recommended fix is to upgrade to Metabase v1.46.6.1 or later.
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 write-up has not been written yet. The Original tab links to the source.
Metabase is a tool for making charts from databases. Before a certain version, someone who was not logged in could get a special setup token and then use a feature that tests database connections to run their own code on the server. That means they could take full control of the machine.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.