CVE-2023–38646 – Pre-Auth RCE in Metabase: One Token to Rule Them All
Metabase exposed its setup token on an unauthenticated API endpoint, allowing an attacker to retrieve it and use it to run arbitrary commands on the server. The author demonstrates achieving a reverse shell without logging in.
Sometimes all it takes is one tiny slip-up – like accidentally leaking a secret token – to let someone waltz in, take a comfy seat on your server, and make themselves at home.
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 returned by an unauthenticated API endpoint and could be used to invoke privileged setup functionality that executed commands.
Impact
An attacker who can reach the Metabase instance could run arbitrary commands, read database files and secrets, and establish persistence.
What the attacker needed
Network access to the Metabase instance; setup token still present
The fix
Metabase patched the issue after July 2023; users should update, revoke the setup token if setup is complete, and restrict access to the API endpoint.
How it was found
- Request the session properties endpoint to retrieve the setup token.
- Clone the public proof-of-concept exploit repository.
- Start a reverse shell listener on the attacker's server.
- Run the exploit script with the target URL, stolen token, and a command to connect back.
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 dashboards from data. When first installed, it creates a special setup token that lets an administrator finish configuration. The bug is that this token could be read by anyone without logging in, and whoever had it could run commands on the server as if they were the administrator.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.