Authlib: Incomplete fix allows HS256 token forgery with prefixed public keys
Summary
Authlib, a Python library for OAuth and OpenID Connect, does not fully block the use of asymmetric public keys as HMAC secrets. If a deployment verifies tokens with a PEM or certificate key that starts with whitespace, a comment or a byte-order mark, and uses the module-level jwt object with its mixed algorithm list, an unauthenticated attacker who holds only that public key can forge HS256 tokens with arbitrary identity or authorization claims. This bypasses the fix for CVE-2024-37568.
Affected
- Authlib from 1.3.1 before 1.9.0 (CVE record)
- The GitHub advisory lists affected versions as 1.3.1 up to and including 1.8.0
- Only deployments that use the documented mixed algorithm registry (module-level jwt object) and PEM or certificate verification keys with a leading prefix are exploitable
Fixed in
- Fixed in Authlib 1.9.0
Workaround
- No vendor-documented workaround. Upgrading is the practical fix.
Exploitation
- CISA SSVC: exploitation status 'poc', automatable 'no', technical impact 'total'.
- Public technical details exist in the advisory, but no public exploit tool was found.
- No known exploitation in the wild was found in the sources.
- Attack requires no authentication and no user interaction.
Our recommendation
- Upgrade Authlib to version 1.9.0 or later and check lockfiles and deployed manifests for 'authlib'.
- Verify whether services use the module-level jwt object with HS and RS/ES algorithms together, and restrict the accepted algorithms to one family.
- Check whether verification keys contain leading whitespace, comments or a BOM, and reload them from a clean source.
- Review token-acceptance logs for unexpected HS256 tokens until patching is complete.
Public exploits
PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.
Research sources
- GitHub Security Advisory GHSA-7vr2-2fgp-9w7p github.com
- Authlib release v1.9.0 github.com
- Fix commit e3bd41cb github.com
- Pull request #945 github.com
- OSV GHSA-7vr2-2fgp-9w7p osv.dev
- VulDB CVE-2026-114615 vuldb.com
Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 31 Oct 2026, 05:27.
Original description (NVD)
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.
NVD references (5)
- https://github.com/authlib/authlib/commit/e3bd41cb29dcfee434453b135ffb487884baeedf
- https://github.com/authlib/authlib/pull/945
- https://github.com/authlib/authlib/releases/tag/v1.9.0
- https://github.com/authlib/authlib/security/advisories/GHSA-7vr2-2fgp-9w7p
- https://github.com/authlib/authlib/security/advisories/GHSA-7vr2-2fgp-9w7p
Sources
The tracker combines official, freely usable data sources – updated continuously:
- NVD (NIST) – CVEs, rating (CVSS), affected products
- CISA KEV – vulnerabilities confirmed by CISA as actively exploited
- CISA Vulnrichment – CISA assessment (SSVC) in the official CVE record
- FIRST EPSS – probability of exploitation
- Microsoft MSRC – Patch Tuesday: vulnerabilities, severity, updates
- PoC-in-GitHub – public proof-of-concept repositories
- Metasploit (Rapid7) – modules of the Metasploit Framework
- Exploit-DB (OffSec) – archive of public exploits (links only)
- Patch days: official vendor pages (linked per vendor) (Vendor patch days)
This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.
Affected? We can help.
We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.
