CVE-2026-114616 — Vulnerability in authlib — CVE Details
Authlib accepts an empty HMAC key, allowing JWS/JWT signature forgery (HS256/HS384/HS512)
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.37%). Schedule for your next planned update.
Does your project use an affected authlib version?
Paste your requirements.txt to check it for CVE-2026-114616 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Reporter: Cavan Loughran, Celvex Group Inc.
Summary
Authlib's symmetric (oct) key handling accepts an empty key (empty bytes b'' / empty string '') as a valid HMAC signing and verification key. An empty HMAC key produces a deterministic digest that any party can reproduce, so an attacker who knows (or can cause) the application to verify a token with an empty key can forge arbitrary tokens that pass HS256/HS384/HS512 signature verification. This is the Authlib member of the cross-language empty-HMAC-key family already assigned CVE-2026-44351 (fast-jwt, npm) and CVE-2026-45363 (ruby-jwt, RubyGems).
This is DISTINCT from Authlib's existing recent JWT-verification advisories. It is not closed by CVE-2026-27962 / GHSA-wvwj-cvrp-7pv5 (JWS JWK header injection, the key=None case), nor by CVE-2026-28802 / GHSA-7wc2-qxgw-g8gg (alg:none blank-signature bypass), nor by GHSA-5357-c2jx-v7qh (algorithm confusion with asymmetric public keys). Those address header-driven key injection, the none algorithm, and asymmetric-vs-symmetric confusion respectively; none of them rejects a zero-length oct key.
Affected versions
Authlib <= 1.7.2 (latest release 1.7.2, 2026-05-06). Confirmed present at the v1.7.2 release tag and on the current main HEAD. The affected code is in authlib/jose/rfc7518/oct_key.py and authlib/jose/rfc7518/jws_algs.py.
Root cause (exact code location, release tag v1.7.2)
- authlib/jose/rfc7518/oct_key.py, class OctKey:
- validate_raw_key is a type-only check:
return isinstance(key, bytes). An empty bytes object passes. - import_key rejects only keys whose material starts with known unsafe prefixes (
if raw_key.startswith(POSSIBLE_UNSAFE_KEYS): raise ValueError(...), i.e. PEM/SSH prefixes). Empty bytes do not match any unsafe prefix, so b'' is accepted. - get_op_key loads the raw key without validating its length.
- No check anywhere rejects a zero-length key, so an empty key b'' passes every gate.
- validate_raw_key is a type-only check:
- authlib/jose/rfc7518/jws_algs.py, class HMACAlgorithm:
- prepare_key:
return OctKey.import_key(raw_data). - sign / verify call key.get_op_key(...) then
hmac.new(op_key, msg, self.hash_alg)/hmac.compare_digest(...). With an empty op key this becomes hmac.new(b'', ...): a deterministic, publicly reproducible digest. There is no empty-key or minimum-length check.
- prepare_key:
Why this is a real signature bypass
An empty HMAC key makes the signature a public, deterministic function of the header and payload, so anyone can compute a valid signature and forge tokens. The realistic trigger matches the sibling CVEs: the deploying application sources the verification key from a place that can be empty at runtime, for example os.environ.get('JWT_SECRET', ''), a database/config column whose default is '', or a key-resolver that returns '' on a miss. Authlib is widely used to BUILD token verifiers (OAuth 2.0 resource servers, OIDC relying parties), and Authlib's own recent advisory history shows the JWS/JWT verify path is the live attack surface, so a key-resolution path that can yield '' is a realistic exposure.
Reproduction (prose, no weaponized exploit)
- In an application that uses Authlib to verify JWS/JWT, arrange for the verification key to be an empty value (e.g. an unset environment variable defaulted to '').
- An attacker constructs a token with header {alg: HS256} and an arbitrary payload, and computes the HS256 signature using an empty key (a value any party can reproduce because the key is empty).
- Authlib's HMAC verification accepts the token as validly signed, because OctKey.import_key did not reject the empty key and hmac.compare_digest matches the attacker-computable digest. The forged token is treated as authentic.
No live system was probed; the above describes the class. The vulnerable code path and the absent guard are confirmed by direct reading of the public source at the v1.7.2 tag and on current main.
Proof the fix is known-good (no novelty risk)
The same maintainer's newer JOSE library, joserfc, ALREADY rejects empty oct key material outright. In src/joserfc/_rfc7518/oct_key.py, import_key raises a ValueError on empty oct material, with an explicit note that an empty oct key produces a deterministic HMAC digest that any party can reproduce, allowing trivial signature forgery in JWS HS256/HS384/HS512 verification. (joserfc additionally warns on keys below 112 bits.) The same guard is simply absent from the older, far more widely deployed Authlib rfc7518 package. The flagship Python JOSE libraries also guard: PyJWT raises InvalidKeyError('HMAC key must not be empty.') for zero-length keys, and jwcrypto enforces an RFC 7518 minimum key length.
Impact
Token forgery / authentication bypass in OAuth 2.0 resource servers and OIDC relying parties built on Authlib whenever the HMAC verification key can be empty at runtime. An attacker can mint tokens with arbitrary claims (for example elevated scopes or another user's subject) that pass signature verification.
Suggested remediation
Reject empty oct key material in OctKey.import_key (and/or validate_raw_key), exactly as the maintainer's joserfc library already does, before the key can reach hmac.new in HMACAlgorithm.sign / verify. Consider also adopting joserfc's sub-112-bit minimum-length warning/rejection for HMAC keys.
Disclosure
Reporter: Cavan Loughran, Celvex Group Inc.
Advisory Timeline
- First published October 27, 2026 (30 days ago).
- Last revised October 30, 2026 — 3 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
pip install "authlib>=1.9.1"
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: PyPI (1).
| Package | Fixed In |
|---|---|
| authlib PyPI · Affected: 0.1, 0.10, 0.11, 0.12 (+61 more) | 1.9.1 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.4 score means for each attack dimension.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
References
- https://github.com/authlib/authlib/security/advisories/GHSA-8m4g-j4wp-wgcgWEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-114616ADVISORY
- https://github.com/authlib/authlib/commit/4ff30db442c70e29486e1982cb0ad37c037f5f4bWEB
- https://github.com/authlib/authlibPACKAGE
- https://github.com/authlib/authlib/releases/tag/v1.9.1WEB
Frequently Asked Questions
- What is CVE-2026-114616?
- Authlib accepts an empty HMAC key, allowing JWS/JWT signature forgery (HS256/HS384/HS512). This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.4/10).
- How do I check if my project is affected by CVE-2026-114616?
- CVE-2026-114616 affects authlib. It has a 0.4% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-114616 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is a below-median EPSS score — only 23% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-27962CRITICAL
Authlib JWS JWK Header Injection: Signature Verification Bypass
- CVE-2026-28802CRITICAL
- CVE-2026-28498HIGH
- CVE-2026-41425MEDIUM
- CVE-2026-44681MEDIUM
- CVE-2025-68158MEDIUM
Authlib has 1-click Account Takeover vulnerability
- CVE-2026-28490MEDIUM
- CVE-2026-41479MEDIUM