Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-29000-pac4j-jwt-auth-bypass — Proof-of-Concept (PoC) for an authentication bypass vulnerability affecting applications using pac4j-jwt with JWE (JSON Web Encryption). | Kitploit
Tools/GitHubGitHub/ptechamanja/cve-2026-29000-pac4j-jwt-auth-bypass
Vulnerability AnalysisExploitationWeb SecurityCTFPenetration TestingAuthentication
GitHubptechamanja/cve-2026-29000-pac4j-jwt-auth-bypass

CVE-2026-29000-pac4j-jwt-auth-bypass

Proof-of-Concept (PoC) for an authentication bypass vulnerability affecting applications using pac4j-jwt with JWE (JSON Web Encryption).

View Repository
1348 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    938
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    556
  • 3

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    352
  • 4

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    343
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    336
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    291

Explore all tools

Browse our collection of tools

View all tools →
Share

HTB Principal — CVE-2026-29000 Writeup

Disclaimer: This exploit was developed solely for the retired HackTheBox machine "Principal". For educational purposes only. Do not use against systems you do not own or have explicit permission to test.

Machine Info

FieldDetails
NamePrincipal
PlatformHackTheBox
Difficulty—
StatusRetired

Vulnerability — CVE-2026-29000

Affected library: pac4j-jwt < 4.5.9 / 5.7.9 / 6.3.3
Severity: Critical
Type: Authentication Bypass

Summary

A logic flaw in JwtAuthenticator allows an attacker to bypass authentication by wrapping an unsigned PlainJWT (alg=none) inside a JWE (encrypted JWT).

When the server decrypts the JWE, it attempts to parse the inner token as a SignedJWT. Because the inner token is a PlainJWT, the SignedJWT object is null and signature verification is skipped entirely. The server then builds a user profile from the unverified claims — allowing full impersonation of any user, including admins.

Attack Requirements

  • The server's RSA public key (often exposed via JWKS endpoint)
  • Knowledge of internal claim names (e.g. roles, subject format)

Exploit Flow

Craft malicious claims (sub=admin, role=ROLE_ADMIN)
        ↓
Build unsigned PlainJWT (alg=none)
        ↓
Wrap PlainJWT inside JWE using server's RSA public key
        ↓
Submit JWE token to server
        ↓
Server decrypts JWE → finds PlainJWT → skips signature check → grants access

Exploit

See exploit.py


Fix

Upgrade pac4j-jwt to a patched version:

  • 4.5.9 or later
  • 5.7.9 or later
  • 6.3.3 or later

Or explicitly reject PlainJWT inner tokens after JWE decryption:

if (jwt instanceof PlainJWT) {
    throw new CredentialsException("PlainJWT not allowed inside JWE");
}

⚙️ Attack Flow

  1. Retrieve public key from:

/api/auth/jwks

  1. Craft malicious JWT:
  • alg: none
  • Inject admin role
  1. Wrap inside JWE using public key

  2. Send as:


Authorization: Bearer <token>

  1. Gain unauthorized access

🛠️ PoC Usage

Install dependencies

pip install jwcrypto requests

Run exploit

python3 poc.py \
--jwks-url http://target/api/auth/jwks \
--target http://target/api/dashboard

📤 Example Output

[+] Forged Token:
eyJhbGciOiJSU0EtT0FFUC0yNTYi...

[+] Browser Injection:
sessionStorage.setItem("auth_token", "eyJhbGciOiJSU0EtT0FFUC0yNTYi...")

[+] Status: 200
{"user":{"username":"admin","role":"ROLE_ADMIN"}}

🌐 Browser Exploitation

Open DevTools → Console:

sessionStorage.setItem("auth_token", "<PASTE_TOKEN_HERE>")

Then navigate to:

/dashboard

🔥 Impact

  • Full authentication bypass
  • Privilege escalation to admin
  • Unauthorized API access
  • Potential lateral movement

🛡️ Mitigation

  • Always verify JWT signatures (JWS) after decryption
  • Reject tokens with alg: none
  • Enforce strict token validation policies
  • Do not rely on encryption alone for trust

👤 Author

  • Doomsknight

References

  • pac4j security advisory
  • HackTheBox
Download Tool