Authlib: Default JWT bearer grant accepts assertions for the wrong audience
- Published
- Last modified
- Status
- published
- Known exploitation
- Not listed in CISA KEV
- Public exploit
- None on Exploit-DB
Summary
Authlib, a Python library used to build OAuth and OpenID Connect servers, is affected through its default JWT bearer grant handling (RFC 7523). The flaw lets a server accept a JWT assertion issued for a different service without checking that the token was meant for it, so an attacker holding such an assertion could obtain an access token across a trust boundary.
Summarized by anthropic/claude-haiku-5.5. Verify details against the original sources.
Read the original description
Authlib is a Python library which builds OAuth and OpenID Connect servers. Prior to 1.9.0, the default RFC 7523 JWTBearerGrant.get_audiences() returns an empty list, causing JWTBearerGrant.verify_claims() to require only that an aud claim exists without matching the current authorization server. An attacker holding a legitimate assertion for another service can present it to a server that shares the signing key and uses the default grant, obtaining an access token across a trust boundary. Implementations that override get_audiences() with the server's valid audience identifiers are not affected. This issue is fixed in version 1.9.0.
Affected versions
- authlib authlib
fixed in 1.9.0