
Docker lab reproducing CVE-2026-72898, a Metabase SQL injection via the password-reset API, with vulnerable and patched instances, exploit script, and recovery tooling.
Metabase is an analytics tool that connects to databases to create query results and dashboards. CVE-2026-72898 is a vulnerability that allowed unauthenticated users to inject SQL into the Metabase application DB by adding an unexpected user-id value to the password reset API. The input schema allowed additional fields, the entire request body was passed into the authentication flow, and the raw expression of the SQL generator was interpreted during the user ID lookup process. As a result, it was possible to create an administrator session and access data in the connected DB.
This repository uses only fictitious customer and order data. The vulnerable Metabase v0.63.2 runs on localhost:3001, and the patched version v0.63.18.3 runs on localhost:3002. The two Metabase instances use separate application DBs and share a single fictitious shopping mall analytics DB. The Docker images contain the built Metabase, and the Python files in this folder run on the PC and send HTTP requests.
exp.py and recover.py use only the standard library)The web ports are bound only to 127.0.0.1. If an existing metabase-lab is running, stop it first. Both configurations use ports 3001 and 3002 on the PC.
In PowerShell, navigate to this folder and run it.
.\start.ps1
On first run, start.ps1 creates a random DB password in .env, downloads the images, and starts the containers. .env is included in .gitignore, so do not upload it to GitHub. Metabase may take a few minutes to become ready.
To run only one side, use .\start.ps1 -Mode vulnerable or .\start.ps1 -Mode patched. The comparison exercise below requires both sides to be running.
http://localhost:3001/setup and http://localhost:3002/setup and create a separate practice admin account for each.| Item | Input value |
|---|---|
| Display name | Virtual shopping mall |
| Host | analytics-db |
| Port | 5432 |
| Database | shop_demo |
| User | analytics_reader |
| Password | The ANALYTICS_READER_PASSWORD value in this folder's .env |
What you connect on this screen is the target DB for analysis. The application DB that stores Metabase accounts and sessions is already connected via the MB_DB_* settings in compose.yaml.
Check the initial state.
.\verify.ps1
Four virtual customers and five orders are expected, with order_105_present=true.
python .\exp.py localhost:3001
.\verify.ps1
python .\exp.py localhost:3002
exp.py accepts only the localhost address of this lab as specified and sends the same password reset request. Because it uses an invalid token, the HTTP 400 on the first request is the expected result on both sides. It then checks whether the admin session can access /api/user/current.
exports/run-.../ and deletes one row of the virtual order order_id=105 from the connected analytics.orders. In verify.ps1, the order count drops from 5 to 4 and order_105_present=false.The direct target of the SQL injection is the Metabase application DB. The order deletion is a follow-up action performed by connecting to Metabase with the admin session that was created. To demonstrate this, the analytics DB connection account was intentionally granted only the DELETE privilege on the virtual order table. If the connection account were read-only, this deletion step could not be performed. The password reset request does not directly delete the order table.
python .\recover.py
.\verify.ps1
docker compose --profile vulnerable --profile patched down
recover.py restores virtual order 105 and cleans up the CSV files created by the lab script. To keep the CSVs, use python .\recover.py --keep-exports. After recovery, 5 orders and order_105_present=true are expected. down preserves the DB volume.
| File | Role |
|---|---|
compose.yaml | Configures the vulnerable and patched Metabase instances, their respective application databases, and the shared virtual analytics database |
start.ps1 | Generates .env passwords and starts Docker Compose |
data/01-seed.sh, data/02-seed.sql | Initializes virtual customer and order data, connection accounts, and privileges |
exp.py | Sends the same SQL injection request to both local versions, and on success saves a CSV and deletes order 105 |
recover.py | Restores and cleans up order 105 and the lab CSVs |
verify.ps1 | Checks container status and virtual data record counts |
.gitignore | Excludes local passwords and CSVs so they don't get committed to Git |
To see the vulnerable point in the source, compare the v0.63.2 password reset API with the same section in the patched line. The lab's v0.63.18.3 is a Docker image tag, while v0.63.18 in this link is the public source tag.