The vulnerability is rooted in commit a61c2acb807496e67f32051b5f1b1d5ccf8f0a75, which changed the NoneAlgorithm.verify method in authlib/jose/rfc7518/jws_algs.py. The original implementation always returned False, correctly rejecting JWTs that claim to have no signature. The patch altered this to return sig == b"", which evaluates to True if the signature part of the JWT is empty. This allows an attacker to forge a token with any claims, set the algorithm in the header to "none", and provide an empty signature, bypassing the cryptographic verification entirely.
The primary user-facing function that triggers this vulnerability is JsonWebToken.decode. In the affected versions, the default jwt instance was initialized with all registered algorithms, including "none". Therefore, calling jwt.decode on a forged token would lead to the invocation of the flawed NoneAlgorithm.verify logic. The patch in commit b87c32ed07b8ae7f805873e1c9cafd1016761df7 remediates this by explicitly defining a list of secure algorithms for the default jwt instance, excluding "none", thus making the library secure by default and preventing the bypass.