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-jweforge — Educational PoC for an alg:none signature-bypass class in JWE-wrapped JWTs (pac4j-jwt) | Kitploit
Tools/GitHubGitHub/tscherwinski/cve-2026-29000-jweforge
Vulnerability AnalysisExploitationWeb Application ExploitationCryptographyPenetration TestingAuthenticationLearning & Education
GitHub
tscherwinski/cve-2026-29000-jweforge

CVE-2026-29000-jweforge

Educational PoC for an alg:none signature-bypass class in JWE-wrapped JWTs (pac4j-jwt)

View Repository
20 days agoNot yet reviewed
Share

JWEforge — alg:none Signature Bypass for JWE-Wrapped JWTs (CVE-2026-29000)

ACHTUNG - Disclaimer — read first

This software is provided for educational purposes and authorized security testing only — against systems you own or for which you have explicit, written permission. Unauthorized access to computer systems is illegal. The author accepts no liability for misuse or for any damage caused by this tool. By using it, you accept full responsibility for your actions. This repository contains no target-specific data; it is a demonstration of a vulnerability class, built against a disposable lab instance.

A proof-of-concept tool that forges authentication tokens for applications which wrap a signed JWT inside a JWE (JSON Web Encryption) and then fail to properly verify the inner signature.

It targets the vulnerability class behind several real pac4j-jwt misconfigurations: the server derives trust from being able to decrypt a token, even though anyone holding the public key can produce a valid ciphertext. When the inner JWT is additionally accepted with alg: none, signature verification disappears entirely and arbitrary claims — including elevated roles — are trusted.

Reference

This PoC demonstrates the authentication-bypass class tracked as CVE-2026-29000, an authentication-bypass vulnerability in pac4j-jwt 4.x, 5.x and 6.x. The public advisory classifies it as an authentication bypass; this tool shows one concrete path — an alg:none inner JWT inside a self-encrypted JWE — and an optional RS256-to-HS256 key-confusion variant. Verify the exact affected versions and fix against the vendor advisory before relying on this in a report.

The vulnerability

A common design encrypts the outer token with the server's public key (for example RSA-OAEP-256 + A128GCM) and signs the inner JWT with RS256. These two layers protect different things, and only one of them proves authenticity:

  • Encryption with a public key guarantees confidentiality, not origin. Because the public key is, by definition, available to everyone (often served at a /jwks endpoint), any party can produce a correctly encrypted token. The outer JWE therefore says nothing about who created the token.
  • All trust then rests on the inner signature. If the server accepts the inner JWT with alg: none, there is no signature to verify and the claims are taken at face value.
  • A related failure is RS256-to-HS256 confusion: if the verifier selects the algorithm from the attacker-controlled header and feeds the RSA public key into an HMAC routine, an attacker can sign a token with HS256 using that public key as the shared secret. The server verifies it against the same key and accepts it.

Either way, an attacker can mint a token with any claims (e.g. an admin role) using only public information and without valid credentials.

What this tool does

  1. Fetches the public key from the target's JWKS endpoint.
  2. Builds an inner JWT with attacker-chosen claims.
  3. Signs it either with alg: none (no signature) or, in confusion mode, with HS256 using several serializations of the public key as the HMAC secret.
  4. Wraps the inner JWT in a JWE (cty: JWT) encrypted to the public key.
  5. Optionally sends the token to one or more endpoints and reports which approach (and, for confusion mode, which key encoding) is accepted.

The multi-candidate confusion mode is the main addition over a minimal PoC: it reports the result of every attempt instead of failing silently, which makes it usable as a quick test across differently-configured targets.

Installation

git clone https://github.com/tscherwinski/CVE-2026-29000-jweforge.git
cd CVE-2026-29000-jweforge
pip install -r requirements.txt

Usage

Only generate a token:

python3 jwe_forge.py --jwks https://lab.example.local/api/auth/jwks \
    --user admin --role ROLE_ADMIN

Generate and test directly against endpoints:

python3 jwe_forge.py --jwks https://lab.example.local/api/auth/jwks \
    --target https://lab.example.local \
    --endpoint /api/users --endpoint /api/settings

Try both attack modes (alg:none and HS256 confusion):

python3 jwe_forge.py --jwks https://lab.example.local/api/auth/jwks \
    --target https://lab.example.local --endpoint /api/users --mode auto

Key options:

OptionMeaning
--jwksJWKS endpoint URL (required)
--user / --rolesub and role claims to put in the token
--issueriss claim (match the target's expected issuer)
--modenone (default), hs256, or auto
--targetbase URL for live testing (optional)
--endpointpath to test, repeatable (optional)

Remediation

  • Pin the expected algorithm server-side; never read the algorithm from the token header. Reject none explicitly.
  • Verify signatures only against the key type they are meant for. Do not pass an RSA public key into an HMAC/symmetric verifier.
  • Do not derive authenticity from an encryption layer. Encryption provides confidentiality, not proof of origin.
  • Keep pac4j / JOSE libraries up to date and review their signature-validation configuration.

License

MIT — see LICENSE.

Download Tool

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.

    871
  • 2

    ghostlock-app

    yukonga/ghostlock-app

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

    548
  • 3

    ARTEX

    baarai/artex

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

    383
  • 4

    redforge

    cybersecurity91/redforge

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

    361
  • 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.

    305
  • 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.

    280

Explore all tools

Browse our collection of tools

View all tools →