REDHAT-BUG-2448164: High severity pypi/authlib vulnerability
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 attacker to forge arbitrary JWT tokens that pass signature verification. When key=None is passed to any JWS deserialization function, the library extracts and uses the cryptographic key embedded in the attacker-controlled JWT jwk header field. An attacker can sign a token with their own private key, embed the matching public key in the header, and have the server accept the forged token as cryptographically valid — bypassing authentication and authorization entirely. This issue has been patched in version 1.6.9.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
authlibto a version that resolves this vulnerability.Fixed in 1.6.9 - Configuration
Update usage so that JWS deserialization functions do not receive key=None; provide the expected trusted verification key instead, since when key=None is passed authlib extracts and uses the cryptographic key from the attacker-controlled JWT JWK header.
Authlib JWS deserialization key=None passed to JWS deserialization function = Do not pass key=None