Authlib: attackers can forge login tokens when the public key has a stray leading character
A login-token library can be tricked into accepting a fake token signed with the server's own public key. An attacker who only knows that public key could create tokens claiming to be any user, including an admin.
| Severity | HighCVSS 7.4 of 10 |
|---|---|
| Being exploited? | UnclearNo reports either way yet |
| Fix available? | Yesauthlib 1.9.0 · since 27 Oct 2026 |
| How sure is this? | Official, 2 sourcesBacked by an official source |
How the attack works simplified
- 1Attacker has public keyPublic key is not secret
- 2Forged HS256 tokenPublic key bytes used as HMAC secret
- 3Authlib accepts tokenLeading byte bypasses the key-type check
- 4Attacker gains accessArbitrary claims accepted as genuine
- ResultAttacker impersonates any user
What happened
In Authlib 1.3.1 through 1.8.0, OctKey.import_key() only detects PEM public keys that begin at byte zero, while the PEM loaders accept leading whitespace, comments, or a byte-order mark. A public key with such a prefix is treated as an HMAC secret, enabling HS256 token forgery. This is a bypass of the fix for CVE-2024-37568.
Are you affected?
You are affected if you use Authlib 1.3.1 through 1.8.0 with the module-level jwt object and verify tokens using a PEM or certificate key whose text does not start at the first byte with "-----BEGIN".
| Package / product | Affected versions | Fixed in |
|---|---|---|
| authlib · pip | >= 1.3.1, <= 1.8.0 | 1.9.0 |
What to do
- Update authlib to 1.9.0 or later
- If you cannot update now, make sure PEM keys start exactly with "-----BEGIN" with no leading spaces, newlines, BOM, or comments
- Where possible, avoid the module-level jwt object and pin the allowed algorithms to asymmetric ones only
Timeline
- 22 Oct 2026, 22:18 UTCPublicly disclosed
- 22 Oct 2026, 22:18 UTCReported by NVD · NVD
- 27 Oct 2026, 15:39 UTCGitHub Advisory reported on it · GitHub Advisory
- 27 Oct 2026, 15:39 UTCFixed version published: authlib 1.9.0 · GitHub Advisory
Sources 2 reports, oldest first
Official vendor, government CERT or advisory database
- NVD22 Oct 2026, 22:18 UTC
- Authlib incomplete algorithm-confusion fix permits HMAC forgery with prefixed public keysGitHub Advisory · 27 Oct 2026, 15:38 UTC
Technical details
- ID
- CVE-2026-114615 · GHSA-7vr2-2fgp-9w7p
- CVSS
- 7.4 / 10
- EPSS
- 0.2% chance of exploitation within 30 days
- Disclosed
- 22 Oct 2026, 22:18 UTC
- On Zero Radar
- before the radar started
- Last change
- 27 Oct 2026, 15:39 UTC
The plain-language parts and the attack diagram were written by an AI model (anthropic/claude-haiku-5.5) from the sources above. Facts like versions, exploitation and dates come from the sources themselves. How Zero Radar works