Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain issuer public key from JWKS
-
DeliveryCraft HS256 token signed with public-key bytes
-
ExploitSubmit forged JWT to relying party
-
ExecutionSignature verification bypassed via key confusion
-
ImpactAuthenticate as arbitrary admin identity
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation completeness
|
| Exploitation Conditions | Exploitation requires two non-default deployment properties, neither attacker-controlled at request time: (1) the relying party uses Authlib's documented module-level jwt object (from authlib.jose import jwt), whose JsonWebToken.decode exposes no 'algorithms' parameter and whose registry includes both HS* and RS*/ES*/PS*/EdDSA, so symmetric and asymmetric schemes are mixed; and (2) the verification key is passed as PEM or X.509 certificate text whose bytes do NOT begin at offset 0 with '-----BEGIN ' - i.e. a single leading newline (as produced by a triple-quoted Python literal), a leading space, four-space indentation (indented YAML/JSON/TOML), a UTF-8 BOM, or a leading comment line. The attacker needs only the issuer's public key (public by definition) and no authentication or user interaction. Limiting factors that reduce real-world exposure: a canonical PEM starting exactly at offset 0 is NOT vulnerable (the guard still fires); pinning the algorithm via JsonWebToken(['RS256']) is confirmed by the PoC's controls to block the forgery; and only the deprecated authlib.jose path is affected (joserfc, the recommended successor, types keys with an explicit kty and raises InvalidKeyTypeError, so it is unaffected). |
| Impact | This is a genuine high-severity authentication-bypass (algorithm/key confusion) in Authlib's deprecated-but-still-shipped authlib.jose module, rated CVSS 7.4. The supplied vector CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N is internally consistent with the description: AV:N (token submitted remotely), PR:N and UI:N (the attacker needs only the issuer's public key, which is public by definition via JWKS/IdP metadata, and no victim interaction), and C:H/I:H (forging arbitrary identity and authorization claims breaks both confidentiality and integrity). AC:H correctly reflects that success is gated on two deployment properties the attacker does not control. No EPSS score and no CISA KEV entry are provided, so there is no evidence of active exploitation - exploitation status is 'no public exploit identified' in KEV terms, but this must not be read as 'no exploit': the GHSA advisory contains a detailed end-to-end proof-of-concept (Flask API, forged HS256 token minted from the public key) reproduced on 1.8.0 and origin/main. The vuln.today decision label is 'this_week' (prioritize, not emergency), which aligns with a serious bug that nonetheless requires a specific non-default configuration. The signals are therefore consistent rather than conflicting: high technical impact and a documented PoC on a package with ~103M monthly PyPI downloads push priority up, while the dependence on a mixed HS/RS algorithm registry plus a leading-byte-prefixed PEM, the absence of KEV/EPSS, and the fact that authlib.jose is deprecated (the vendor recommends joserfc, which is not affected) temper real-world blast radius. Net: a real patch-this-week priority for anyone using authlib.jose's module-level jwt object with PEM/certificate verification keys, not merely a high-CVSS paper risk. |
| Exploit ScenarioDerived | An unauthenticated attacker retrieves the issuer's RSA or EC public key - publicly available at /.well-known/jwks.json or in IdP metadata - and uses those exact PEM bytes as an HMAC secret to mint an HS256 JWT carrying arbitrary subject and role claims (e.g. sub=attacker, role=admin). Against a relying party that calls Authlib's documented module-level jwt.decode() with a verification key stored as PEM/certificate text that has any leading byte (newline, space, indentation, BOM, or comment line), the forged token verifies as authentic and grants admin access. A full end-to-end PoC demonstrating exactly this (yielding HTTP 200 and admin secrets) is published in the GHSA advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 22, 2026
Authentication bypass in Authlib's deprecated-but-still-shipped authlib.jose module (1.3.1 through 1.8.0, fixed in 1.9.0) lets an unauthenticated remote attacker forge HS256 JSON Web Tokens with arbitrary subject and role claims using nothing but the issuer's public key, because the OctKey.import_key() guard tests for PEM armour only at byte zero while the PEM loaders skip leading whitespace, comment lines or a BOM. Two non-default deployment properties are required: the relying party uses the documented module-level jwt object (whose registry mixes HS* with RS*/ES*/PS*/EdDSA and whose decode exposes no algorithms parameter), and the verification key is stored as PEM or X.509 certificate text that does not begin at offset 0 with '-----BEGIN ' - a canonical PEM is still blocked, and pinning the algorithm (e.g. JsonWebToken(['RS256'])) is confirmed to reject the forgery. Rated CVSS 7.4 (AV:N/AC:H/PR:N/UI:N, C:H/I:H) and not listed in CISA KEV; the upstream advisory includes an end-to-end proof-of-concept reproduction against 1.8.0.
RemediationAI
Upgrade to Authlib 1.9.0, the vendor-released patch that replaces the byte-zero startswith() check with a substring-based _check_key() applied both at import and on key use (PR #945, commit e3bd41cb29dcfee434453b135ffb487884baeedf, release v1.9.0). Because that release also makes audience validation mandatory in the JWT bearer grant (empty get_audiences() now raises invalid_grant instead of being skipped) and switches OIDC grant code to request.scope rather than request.payload.scope, test token-exchange and hybrid/implicit flows before rolling it out. Where an immediate upgrade is not possible, the confirmed workaround is to stop relying on the mixed registry: construct JsonWebToken(['RS256']) (or the exact asymmetric algorithm in use) so HMAC tokens are rejected with UnsupportedAlgorithmError regardless of key bytes - this requires touching every decode call site that currently uses the module-level jwt object, and it does not protect call sites that were missed. Ensuring the stored verification key bytes begin exactly at offset 0 with '-----BEGIN ' also keeps the original guard effective, but that is fragile because a triple-quoted Python literal, an indented YAML/JSON/TOML block or a BOM introduced by an editor silently reintroduces the flaw. Migrating off the deprecated authlib.jose module to joserfc is the durable fix, since joserfc types keys with an explicit kty and rejects HS256 against an RSAKey/ECKey outright.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The root cause is an incomplete denylist (CWE-184) that produces a signature-verification bypass (CWE-347), commonly called algorithm or key confusion. In authlib/jose/rfc7518/oct_key.py, OctKey.import_key() is the only backstop that prevents asymmetric public-key material from being treated as an HMAC secret, and it implemented that check as raw_key.startswith(POSSIBLE_UNSAFE_KEYS), anchored at byte 0, over markers such as b'-----BEGIN ', b'ssh-rsa ' and b'ecdsa-sha2-'. On the asymmetric path, authlib/jose/rfc7517/_cryptography_key.py hands the identical bytes to cryptography's load_pem_public_key / load_pem_x509_certificate, which scan forward for the armour header and therefore accept leading newlines, spaces, indentation, UTF-8 BOMs and comment lines. The recogniser's reject set is thus strictly smaller than the loader's accept set, and anything in the difference falls through into OctKey and becomes the HMAC secret; HMACAlgorithm.prepare_key in rfc7518/jws_algs.py returns OctKey.import_key(raw_data) directly, so there is no second check. Because JsonWebToken.decode in rfc7519/jwt.py takes no algorithms parameter and the module-level jwt object in authlib/jose/__init__.py registers HS256/HS384/HS512 alongside RS*/ES*/PS*/EdDSA, an attacker who knows the public verification key can mint {'alg':'HS256'} tokens that decode as authentic. This is a bypass of the fix for CVE-2024-37568 / GHSA-5357-c2jx-v7qh; the upstream fix in PR #945 replaces the anchored startswith() with an any(marker in raw_key ...) membership test applied at import and on key use. The recommended successor library, joserfc, types keys with an explicit kty and raises InvalidKeyTypeError for this combination, so it is not affected by this mechanism.
Know when Authlib 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:H/PR:N/UI:N/S:U/C:H/I:H/A:N
PR:N because the attacker needs only the public key; AC:H because success depends on a mixed HS/RS registry and a leading-byte-prefixed PEM not attacker-controlled; C:H/I:H for arbitrary claim forgery, A:N.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
Authlib is a Python library which builds OAuth and OpenID Connect servers. From 1.3.1 until 1.9.0, OctKey.import_key() checks asymmetric-key markers only at byte zero while Authlib's PEM loaders accept leading whitespace, comments, or a byte-order mark. In deployments that use the documented mixed algorithm registry and already configure verification with PEM or certificate bytes containing such a prefix, an unauthenticated attacker who knows those same public-key bytes can use them as an HMAC secret and forge HS256 tokens with arbitrary identity or authorization claims. This is a bypass of the remediation for CVE-2024-37568. The module-level jwt object reaches OctKey.import_key() in authlib/jose/rfc7518/oct_key.py, where POSSIBLE_UNSAFE_KEYS fails to identify prefixed asymmetric key material. This issue is fixed in version 1.9.0.
Technical POC Analysis
CWE-184, Incomplete List of Disallowed Inputs, leading to CWE-347, improper signature verification and algorithm confusion.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
A high-severity authentication bypass in the Authlib library (versions 1.3.1-1.8.0) could allow unauthenticated attackers to forge JSON Web Tokens when specific non-default deployment patterns are used. This affects products integrating Authlib for JWT validation, potentially enabling unauthorized access and privilege escalation, but only under narrow conditions that many deployments may not meet. Leadership should prioritize remediation because the vulnerability directly undermines authentication integrity and is rated high severity, though no active exploitation is currently reported.
No vendor-released patch identified at time of analysis. Interim mitigations: pin the JWT algorithm to a specific secure algorithm (e.g., RS256) and ensure PEM keys are stored in canonical form starting with '-----BEGIN ' at offset 0; avoid using the deprecated module-level jwt object; monitor for anomalous authentication attempts.
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
Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.
Authlib is a Python library which builds OAuth and OpenID Connect servers. [CVSS 5.7 MEDIUM]
Authentication bypass in Authlib (Python OAuth/OpenID Connect library) versions 1.6.5 through 1.6.6 allows remote attack
Authlib is a Python library which builds OAuth and OpenID Connect servers. Rated high severity (CVSS 7.5), this vulnerab
Authlib's JOSE/JWS verification path (through 1.6.4, with 1.6.5 as the fix) decodes attacker-supplied JWT/JWS header and
lepture Authlib before 1.3.1 has algorithm confusion with asymmetric public keys. Rated high severity (CVSS 7.5), this v
Unbounded DEFLATE decompression in Authlib's JWE zip=DEF handling (authlib/jose/rfc7518/jwe_zips.py) lets a small, valid
Signature verification bypass in Authlib 1.7.2 and earlier allows unauthenticated remote attackers to have crafted JWS J
Poisoned OAuth/OIDC discovery metadata in Authlib 1.7.2 and earlier allows an attacker who controls or intercepts the me
Authentication bypass in the joserfc Python library before 1.7.4 lets remote, unauthenticated attackers submit a JWS Gen
Token forgery in the Authlib Python library before 1.9.1 lets a remote, unauthenticated attacker mint HS256, HS384 or HS
Authlib's default RFC 7523 JWT bearer grant, in all releases prior to 1.9.0, fails to bind an incoming JWT assertion to
Server-side request forgery in Authlib's RFC 9101 JWTAuthenticationRequest (JAR) extension lets unauthenticated remote a
EUVD-2026-108514
NVD
CVE.org
EPSS
GitHub
Exploit-DB