Critical (9.1)

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:

  1. Inventory: Identify all applications and services that depend on the Python authlib package.
  2. Version Check: Verify the installed version. Any version prior to 1.6.9 is vulnerable.
  3. Code Review: Check your code for calls to JWS deserialization functions (like jose.jwt.decode with JWS algorithms) where the key parameter might be implicitly or explicitly set to None. Ensure a trusted, server-side key is always provided for verification.
  4. 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.

Share:

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

Never Miss a Critical Alert

CVE advisories, breach reports, and threat intel — delivered daily to your inbox.