Authlib's implementation examples for the RFC 7592 dynamic client registration management protocol omit a critical security check that binds the registration_access_token to the specific client being accessed. This omission allows an attacker possessing any valid registration_access_token and a target client_id to bypass authorization controls and read, update, or delete other clients' registrations. The vulnerability affects Authlib versions from 0.15 up to but not including 1.9.1 and is fixed in version 1.9.1.
Authlib versions up to 1.7.2 accept an empty HMAC key for JWS/JWT HS256/HS384/HS512 signature verification, allowing attackers to forge tokens with arbitrary claims. The empty key produces a deterministic digest that anyone can reproduce, bypassing signature verification. This vulnerability affects OAuth 2.0 resource servers and OIDC relying parties using Authlib if the verification key can be empty at runtime. The issue is fixed in Authlib 1.9.1.
Authlib versions 1.6.0 through before 1.9.0 contain a vulnerability in the RFC 9101 JAR extension where the attacker-controlled request_uri parameter is passed to a fetch hook without validation at a pre-authentication endpoint. This allows an unauthenticated Server-Side Request Forgery (SSRF) primitive because the documented example implementation performs an unrestricted HTTP GET on the request_uri. The vulnerability arises because the existing allowlist controls for request_uris are ignored, and the extension does not implement required RFC 9101 controls such as validating the URI location, media type, or timeouts. A fix is available in version 1.9.0.
Authlib versions prior to 1.9.0 contain a vulnerability in the OpenID ID token nonce validation process. The ID token's nonce validation can be disabled if the token includes a boolean false nonce_supported claim, causing the expected nonce to be set to None and skipping nonce validation. This allows an attacker to replay a validly signed ID token from a victim into an attacker-controlled session, authenticating as the victim. The vulnerability affects implicit and hybrid flows and direct calls to parse_id_token(), but not the authorization code flow. A fix is available in version 1.9.0.
Authlib versions prior to 1.9.0 have a vulnerability in the default JWT bearer grant implementation where the audience ('aud') claim in JWT assertions is not properly validated. The default get_audiences() method returns an empty list, causing verify_claims() to only check for the presence of an 'aud' claim rather than verifying it matches the authorization server's token endpoint. This allows an attacker with a valid JWT for any audience to obtain an access token from a different authorization server sharing the same signing key.
Authlib versions prior to 1.9.0 contain a vulnerability in the OpenID Connect implicit grant implementation where the authorization request's raw scope parameter is checked instead of the filtered allowed scope. This allows a registered OAuth client, which is not permitted the 'openid' scope but allowed other scopes like 'profile', to obtain a signed ID token if the user consents. The ID token includes identity claims such as 'sub' and 'name', effectively bypassing intended scope restrictions. The issue is fixed in version 1.9.0.
Authlib versions from 1.3.1 up to but not including 1.9.0 contain a vulnerability in the handling of HMAC keys in the jose module. The check that prevents asymmetric public keys from being used as HMAC secrets only inspects the start of the key bytes, but the asymmetric key loader skips leading bytes before the PEM header. This discrepancy allows an attacker with only the issuer's public key to craft a valid HS256 token with arbitrary claims that will be accepted as authentic. The issue is an incomplete fix of a previous vulnerability (CVE-2024-37568) and affects the documented usage of the jwt.decode method. A fix is available in version 1.9.0.
Authlib versions from 0.13 up to 1.7.2 contain a vulnerability in the is_secure_transport() function, which incorrectly treats certain HTTP URLs with userinfo components as secure loopback addresses. This allows an attacker to bypass the TLS enforcement by crafting URLs like http://localhost:80@evil.example/cb, where the actual host is external but the function returns true due to a prefix string match. This flaw affects OAuth 2.0 / OIDC endpoint and redirect URI validation, potentially allowing cleartext HTTP URLs to be accepted where TLS is required. The issue is fixed in Authlib 1.8.0.
Authlib version 1.8.0 and earlier contains a critical vulnerability in its JsonWebSignature.deserialize_json() method, which bypasses signature verification. This flaw allows the method to return the payload as successfully verified without actually checking the signature or requiring a cryptographic key.
Authlib's OAuth 2.0 authorization endpoint in kimi-cli versions prior to 1.6.10, certain 1.7.x versions, and some 2.x versions contains an open redirect vulnerability. This occurs when an unsupported response_type is used along with an attacker-controlled redirect_uri, allowing redirection without client validation or user authentication. The flaw exists because the server returns a redirect response to the supplied redirect_uri before validating the client or redirect URI. This vulnerability has a CVSS score of 5.4 (medium severity) and affects multiple versions as specified. A patch is available to address this issue.
Multiple critical vulnerabilities were identified and fixed in python-Authlib. These include a signature bypass in JWS deserialization allowing use of user-controlled embedded JWK keys, a cryptographic padding oracle in the JWE RSA1_5 key management algorithm, and a fail-open issue in OIDC hash validation that bypasses mandatory integrity protections. The issues affect versions prior to 1.5.3 and between 0.40 and before 1.17.0. Fixed versions 1.5.3 and 1.17.0 address these flaws.