Impact
Authlib permitted the use of a zero‑length HMAC key in its OctKey.import_key() routine and during HMAC signing and verification. An attacker who can make the application’s secret lookup return an empty string or empty bytes can deterministically compute HS256, HS384 or HS512 signatures for any desired token claims. This enables the forging of signed JWTs that Authlib will accept as authentic, exposing the system to unauthorized access and privilege escalation. The weakness is documented by CWE-1391, CWE-287, CWE-326 and CWE-347.
Affected Systems
Authlib library, any application using authlib:authlib before version 1.9.1.
Risk and Exploitability
The CVSS score of 7.4 indicates a high severity, and the EPSS score is not available. The vulnerability is not listed in the CISA KEV catalog. An attacker can exploit the flaw remotely, provided they can influence the secret lookup to return an empty key. The attack requires no privilege on the server and can be performed over the network by submitting forged JWTs to any endpoint that parses and verifies tokens using Authlib.
OpenCVE Enrichment
Github GHSA