Authlib: Fail-Open Cryptographic Verification in OIDC Hash Binding
Description
Authlib is a Python library which builds OAuth and OpenID Connect servers. Prior to version 1.6.9, a library-level vulnerability was identified in the Authlib Python library concerning the validation of OpenID Connect (OIDC) ID Tokens. Specifically, the internal hash verification logic (_verify_hash) responsible for validating the at_hash (Access Token Hash) and c_hash (Authorization Code Hash) claims exhibits a fail-open behavior when encountering an unsupported or unknown cryptographic algorithm. This flaw allows an attacker to bypass mandatory integrity protections by supplying a forged ID Token with a deliberately unrecognized alg header parameter. The library intercepts the unsupported state and silently returns True (validation passed), inherently violating fundamental cryptographic design principles and direct OIDC specifications. This issue has been patched in version 1.6.9.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
authlibPyPI | < 1.6.9 | 1.6.9 |
Affected products
1Patches
1b9bb2b25bf8bfix(oidc): fail close at validating c_hash and at_hash
2 files changed · +8 −6
authlib/oidc/core/claims.py+2 −2 modified@@ -303,6 +303,6 @@ def get_claim_cls_by_response_type(response_type): def _verify_hash(signature, s, alg): hash_value = create_half_hash(s, alg) - if not hash_value: - return True + if hash_value is None: + return False return hmac.compare_digest(hash_value, to_bytes(signature))
tests/core/test_oidc/test_core.py+6 −4 modified@@ -99,9 +99,10 @@ def test_validate_at_hash(): ) claims.params = {"access_token": "a"} - # invalid alg won't raise + # invalid alg will raise too claims.header = {"alg": "HS222"} - claims.validate(1000) + with pytest.raises(InvalidClaimError): + claims.validate(1000) claims.header = {"alg": "HS256"} with pytest.raises(InvalidClaimError): @@ -143,10 +144,11 @@ def test_hybrid_id_token(): with pytest.raises(MissingClaimError): claims.validate(1000) - # invalid alg won't raise + # invalid alg will raise too claims.header = {"alg": "HS222"} claims["c_hash"] = "a" - claims.validate(1000) + with pytest.raises(InvalidClaimError): + claims.validate(1000) claims.header = {"alg": "HS256"} with pytest.raises(InvalidClaimError):
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- github.com/advisories/GHSA-m344-f55w-2m6jghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2026-28498ghsaADVISORY
- github.com/authlib/authlib/commit/b9bb2b25bf8b7e01512d847a95c1749646eaa72bghsax_refsource_MISCWEB
- github.com/authlib/authlib/releases/tag/v1.6.9ghsax_refsource_MISCWEB
- github.com/authlib/authlib/security/advisories/GHSA-m344-f55w-2m6jghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.