The vulnerability lies in the authlib library's handling of JSON Web Signatures (JWS). Specifically, the JsonWebSignature._prepare_algorithm_key function in authlib/jose/rfc7515/jws.py would fall back to using a key provided in the jwk header of the token if the application did not supply a key for verification. This allows an attacker to craft a token, sign it with their own private key, and embed their public key in the jwk header. When the server processes this token and the key lookup returns None (a common case, for example, when a key ID kid is not found), authlib would use the attacker's public key from the header to validate the signature. The signature would pass verification, and the application would trust the claims in the forged token, leading to a complete authentication and authorization bypass. The fix, as seen in commit a5d4b2d4c9e46bfa11c82f85fdc2bcc0b50ae681, removes this dangerous fallback logic. A similar vulnerability was also patched in the prepare_key function within authlib/jose/rfc7516/jwe.py.