Authlib JWK Header Injection (CVE-2026-27962)
CVE-2026-27962
Authlib is a Python library which builds OAuth and OpenID Connect servers. Prior to version 1.6.9, a JWK Header Injection vulnerability in authlib's JWS implementation allows an unauthenticated attack...
Overview
A critical security flaw has been discovered in Authlib, a popular Python library for building OAuth and OpenID Connect servers. This vulnerability, tracked as CVE-2026-27962, allows an unauthenticated attacker to forge JSON Web Tokens (JWTs) that are incorrectly accepted as valid by an affected server. This can lead to a complete bypass of authentication and authorization controls.
Vulnerability Explained
In simple terms, this is a signature verification bypass. When an application uses a vulnerable version of Authlib to check the digital signature of a JWT (a common security token), the library can be tricked into using a cryptographic key supplied by the attacker within the token itself, instead of using the server’s own trusted key.
The flaw exists in the JWS (JSON Web Signature) deserialization functions. If the function is called with key=None, the library will extract the key from the token’s jwk header field, which is controlled by the attacker. An attacker can sign a malicious token with their own private key, embed the corresponding public key in the header, and the vulnerable server will accept it as legitimate.
Impact
The impact of this vulnerability is severe. By forging valid JWTs, an attacker can:
- Impersonate any user, including administrators.
- Gain unauthorized access to protected data and functions.
- Completely bypass login systems and API authentication.
- Potentially take full control of applications relying on Authlib for security.
With a CVSS score of 9.1 (CRITICAL), this flaw represents a major threat to any application using a vulnerable version of Authlib for processing JWTs. Successful exploitation could lead to significant data breaches; you can review historical incidents in our breach reports to understand potential consequences.
Remediation and Mitigation
Immediate action is required to secure affected systems.
Primary Fix: Update Authlib The issue is patched in Authlib version 1.6.9. All users must upgrade immediately.
pip install --upgrade authlib>=1.6.9
Verification and Mitigation:
- Inventory: Identify all applications and services that depend on the Python
authlibpackage. - Version Check: Verify the installed version. Any version prior to 1.6.9 is vulnerable.
- Code Review: Check your code for calls to JWS deserialization functions (like
jose.jwt.decodewithJWSalgorithms) where thekeyparameter might be implicitly or explicitly set toNone. Ensure a trusted, server-side key is always provided for verification. - Monitor: Closely monitor authentication logs for any suspicious activity or unexpected token issuances. Staying informed on emerging threats is crucial; follow the latest developments in our security news section.
After patching, consider conducting a security review to ensure no unauthorized access occurred during the window of vulnerability.
Never miss a critical vulnerability
Get real-time security alerts delivered to your preferred platform.
Am I Affected by CVE-2026-27962?
Pick an ecosystem, paste your installed version, and we'll compare it against the fixed version published on OSV.dev. Browser-only — nothing is sent to a server.
Heuristic comparison only. Always cross-check against the vendor advisory before making patching decisions.
Related Advisories
A condition in ScreenConnect may allow an actor with access to server-level cryptographic material used for authentication to obtain unauthorized access, including elevated privileges, in certain scen...
JOSE is a Javascript Object Signing and Encryption (JOSE) library. Prior to version 0.3.5+1, a vulnerability in jose could allow an unauthenticated, remote attacker to forge valid JWS/JWT tokens by us...
OpenClaw before 2026.3.12 contains an authentication bypass vulnerability in Feishu webhook mode when only verificationToken is configured without encryptKey, allowing acceptance of forged events. Una...
Pachno 1.0.6 contains a deserialization vulnerability that allows unauthenticated attackers to execute arbitrary code by injecting malicious serialized objects into cache files. Attackers can write PH...