CVE-2026-114619: Authlib: OpenID implicit grant checks raw scope instead of allowed scope before issuing ID tokens
In authlib, OpenIDImplicitGrant checks the raw scope a client sends instead of the scope the client is allowed. A registered client barred from the openid scope can still request scope=openid profile and receive a signed ID token once the user consents. Authorization servers registering OpenIDImplicitGrant before authlib 1.9.0 are affected. Upgrade to 1.9.0.
Published Oct 27, 2026 · Analysis Nov 1, 2026
What an attacker can do
OpenIDImplicitGrant.validate_authorization_request() first runs the parent ImplicitGrant check, which filters the requested scope through client.get_allowed_scope() into request.scope. It then calls is_openid_scope() on request.payload.scope, the raw value the client sent. So openid in the request satisfies the check even when the filtered scope lacks it.
The attacker must control a registered client that may use the id_token or id_token token response type, whose allowed scopes include something like profile but not openid. A user must log in and approve the request. The result is an RS256-signed ID token with sub, name, nonce, at_hash and aud set to the attacking client. A consent page built as the docs show lists only profile, so the user is not told an identity token is issued.
The access token stays limited with the built-in BearerTokenGenerator, and UserInfoEndpoint returns 403 insufficient_scope. The authorization code flow issues no ID token for the same client. The reporter rates practical severity as medium. A custom token generator that does not filter scope would also grant the client scopes it is not allowed.
Who is affected
authlib before 1.9.0. The report verified v1.8.0 (commit c529a61a) and did not test earlier releases. You are exposed if you call server.register_grant() with OpenIDImplicitGrant or a subclass, and some client may use id_token responses without being allowed openid. Servers that only use the authorization code flow, or where every such client is allowed openid, are not affected.
pip show authlibauthlib
- Ecosystem
- PyPI
- Affected
- < 1.9.0
- Fixed in
- 1.9.0
- Check
pip show authlib
How to fix it
Upgrade to authlib 1.9.0:
pip install --upgrade "authlib>=1.9.0"The advisory's suggested change is to check self.request.scope instead of self.request.payload.scope, and to pass the filtered scope to generate_token in create_granted_params(). Until you upgrade, make sure every client allowed an id_token or id_token token response type is also allowed the openid scope, or remove the implicit response types from clients that do not need them.
How to tell if you were hit
Search authorization logs for implicit-flow requests with response_type containing id_token and scope containing openid from clients whose registered scope does not. Check the client table for entries that have implicit OIDC response types but no openid scope. Inspect redirects for id_token= fragments sent to those clients. Any ID token issued to such a client points to this bug being used.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Report metadata
| Field | Value | | Package | `authlib` (PyPI, `pkg:pypi/authlib`) | | Repository | https://github.com/authlib/authlib | | Component | `authlib.oidc.core.grants.implicit.OpenIDImplicitGrant.validate_authorization_request` | | Vulnerability class | Authorization bypass: a client's scope restriction is bypassed for OpenID Connect ID token issuance | | Verified against | `c529a61af40e3efe05286140e00fbdced07d7987` (v1.8.0). Earlier releases were not checked. | | API surface | Public API (`OpenIDImplicitGrant`, registered with `server.register_grant(...)`) | | Affected in default configuration | Yes. No non-default option is needed once `OpenIDImplicitGrant` is registered. Client metadata decides exposure: Authlib's standard `ClientMixin` checks response type and scope independently, so a client can be permitted `id_token` responses without being allowed the `openid` scope. |
Summary
OpenIDImplicitGrant.validate_authorization_request() first runs the parent ImplicitGrant validation, which filters the requested scope through client.get_allowed_scope() and stores the result in request.scope. It then decides whether this is an OpenID request by checking the raw, client-supplied request.payload.scope instead of that filtered value. A client that is allowed profile but not openid can therefore request scope=openid profile, pass the check, and receive a signed ID token (with sub and profile claims) once the user consents. This happens even when Authlib's built-in, scope-filtering BearerTokenGenerator is in use.
The tainted input is the authorization request's scope parameter. The OAuth client fully controls it, and the client is the very party the scope restriction is meant to constrain. Any registered client can add openid to its request if it is permitted an id_token or id_token token response type and its allowed scopes exclude openid but include a claim-bearing scope such as profile.
Sibling paths treat the same client correctly, which suggests the raw-scope check is a bug rather than intended behaviour:
ImplicitGrant.validate_authorization_request()-> filters the requested scope throughclient.get_allowed_scope()intorequest.scope(safe, `authlib/oauth2/rfc6749/grants/implicit.py` lines 141-147)OpenIDImplicitGrant.validate_authorization_request()-> checks the raw `request.payload.scope` (unsafe, [`authlib/oidc/core/grants/implicit.py` line 72](https://github.com/authlib/authlib/blob/c529a61af40e3efe05286140e00fbdced07d7987/authlib/oidc/core/grants/implicit.py#L72))UserInfoEndpoint-> rejects the same client's access token with 403insufficient_scope(safe; observed during verification, line not recorded)- OIDC authorization code flow -> issues no
id_tokenfor the same client (safe; observed during verification, line not recorded)
Impact
A registered OAuth client that the operator has excluded from the openid scope can get an OpenID Connect ID token for any user who logs in and approves its authorization request. During verification the provider returned an RS256-signed ID token carrying iss, aud (the requesting client), nonce, auth_time, at_hash, sub and name, while the granted scope was only profile. A consent page built the way the Authlib docs show lists only profile, so the user is not shown that an identity token will be issued.
Without this bug, the same request fails with InvalidScopeError ("Missing 'openid' scope") because the client's resolved scope does not include openid. The new capability is the ID token itself: a signed assertion of the user's identity (sub) plus claims from the client's other allowed scopes. Gating that token is exactly what the openid scope is for. The access token stays restricted when the built-in token generator is used: Authlib's UserInfoEndpoint rejects it with 403 insufficient_scope.
Scoring note: we did not compute a CVSS score. An initial triage rated this High. After dynamic verification we assess practical severity as closer to Medium, because:
- The attacker must be a registered client that is permitted
id_tokenresponse types. - The user must log in and consent.
- The ID token's
audis the attacking client.
Two kinds of deployment are not affected:
- Deployments that use only the OIDC authorization code flow. During verification, that flow issued no ID token for the same client.
- Deployments where every client permitted an
id_tokenorid_token tokenresponse type is also allowed theopenidscope.
Preconditions
- The authorization server registers
OpenIDImplicitGrant(or a subclass), e.g.server.register_grant(MyOpenIDImplicitGrant). The vulnerable method runs on every OIDC implicit authorization request. - A client's metadata permits an OIDC implicit response type (
id_tokenorid_token token). Nothing in Authlib ties this to theopenidscope. The standard SQLAlchemyClientMixinchecks response type and scope independently, and it filters requested scopes against the client's allowed scopes at `authlib/integrations/sqla_oauth2/client_mixin.py:124-129`. - That client's allowed scopes exclude
openidbut include another claim-bearing scope, such asprofile. - The attacker controls that registered client and sends an authorization request that adds
openidto otherwise allowed scopes (e.g.scope=openid profile), with anonce. - A user logs in and approves the request.
- Branch condition: the raw
request.payload.scopecontainsopenidwhile the filteredrequest.scopedoes not. Sois_openid_scope(self.request.payload.scope)is true atimplicit.py:72and noInvalidScopeErroris raised.
No non-standard usage, monkey-patching or unusual configuration is needed: this is the public grant used as intended. Keeping a client's response types and allowed scopes in sync is not documented as the integrator's responsibility. The parent grant stores the filtered request.scope specifically so that authorization decisions use it. We did not capture a link to the relevant Authlib docs page, but the verification built its consent page the way those docs show.
Data flow
- Source: the OAuth client controls the authorization request's
scopeparameter, e.g.GET /authorize?response_type=id_token%20token&client_id=c&redirect_uri=https%3A%2F%2Fc%2Fcb&scope=openid%20profile&nonce=n. The raw value remains available asrequest.payload.scope. - Propagation:
ImplicitGrant.validate_authorization_request()filters the requested scope throughclient.get_allowed_scope()and stores the result inrequest.scope(here'profile').request.payload.scopestill holds the rawopenid profile(`authlib/oauth2/rfc6749/grants/implicit.py:141-147`). - Sink:
OpenIDImplicitGrant.validate_authorization_request()uses the raw value to decide whether this is an OpenID request:if not is_openid_scope(self.request.payload.scope):(`authlib/oidc/core/grants/implicit.py:72`). The injectedopenidsatisfies the check, so the method returns the redirect URI instead of raisingInvalidScopeError(`authlib/oidc/core/grants/implicit.py:70-84`). - Reachability:
OpenIDImplicitGrantis the public grant that serves OIDC implicit authorization requests. After the user consents,create_granted_params()andprocess_implicit_token()issue the ID token and user claims (`authlib/oidc/core/grants/implicit.py:112-129`, `authlib/oidc/core/grants/implicit.py:132-169`).
Vulnerable code
authlib/oidc/core/grants/implicit.py, lines 70-84 at c529a61af40e3efe05286140e00fbdced07d7987 (an excerpt; ... marks code left out of the captured snippet):
redirect_uri = super().validate_authorization_request() # safe: parent grant sets the filtered request.scope
if not is_openid_scope(self.request.payload.scope): # <-- sink (line 72): raw, client-supplied scope
raise InvalidScopeError("Missing 'openid' scope", ...)
...
return redirect_uriReproduction
Verified two ways on Authlib c529a61af40e3efe05286140e00fbdced07d7987 (v1.8.0):
- a pytest PoC using the Flask test client
- a standalone Flask OpenID Provider on localhost, driven with
curl
The Python and Flask versions were not recorded.
Setup: a client registered with scope='profile' only (no openid) and response types id_token / id_token token. It uses Authlib's built-in SQLAlchemy ClientMixin and the built-in scope-filtering BearerTokenGenerator.
- The client sends an authorization request with
scope=openid profileand anonce. ImplicitGrantsetsrequest.scope='profile'. A consent page built the way the docs show displays onlyprofile.OpenIDImplicitGrant.validate_authorization_request()checks the rawrequest.payload.scopeat line 72, so the request passes.- After the user approves, the provider returns an RS256-signed ID token with
iss,aud(the client),nonce,auth_time,at_hash,subandname, while the granted scope isprofile. The ID token's signature verified against the provider's JWKS.
Controls run during verification:
- The same request without
openidreturnsinvalid_scope("Missing 'openid' scope"). - Authlib's
UserInfoEndpointrejects this client's access token with 403insufficient_scope. - The OIDC authorization code flow for the same client issues no
id_token.
The sketch below shows the request shape against Authlib's Flask OIDC test app. The verification's own test script is not included here.
# Client metadata: scope='profile' (no openid), response_types=['id_token token'].
rv = client.get('/authorize?response_type=id_token%20token&client_id=client-id&redirect_uri=https%3A%2F%2Fclient.test%2Fauthorized&scope=openid%20profile&nonce=n')
# after the user grants consent:
assert 'id_token=' in rv.headers['Location'] # should have been rejected: openid is not an allowed scope- Expected:
InvalidScopeError/invalid_scope("Missing 'openid' scope"), because the client's resolved allowed scope (request.scope == 'profile') does not includeopenid. - Actual: after consent, the redirect carries a signed ID token (including
subandname) while the granted scope isprofile.
Suggested remediation
Decide whether to issue OpenID tokens from the scope the grant actually authorized, never from the raw requested scope. The authorized scope is self.request.scope, which the parent grant has already filtered through client.get_allowed_scope().
redirect_uri = super().validate_authorization_request()
-if not is_openid_scope(self.request.payload.scope):
+if not is_openid_scope(self.request.scope):
raise InvalidScopeError("Missing 'openid' scope", ...)During verification, this one-line change at line 72 blocked the exploit, and the existing OIDC implicit/hybrid tests still passed (23 passed).
The same rule should hold for the rest of OIDC issuance. create_granted_params() (`authlib/oidc/core/grants/implicit.py:112-129`) passes the raw payload.scope to generate_token. It should pass self.request.scope instead.
Notes:
- Adjacent raw-scope use, worth fixing in the same change:
create_granted_params()hands the rawpayload.scopetogenerate_token. So a deployment whose custom token generator does not filter scope also grants the client access-token scopes it is not allowed; verification notedopenidandemail. Authlib's built-inBearerTokenGeneratorre-filters the access-token scope, so this only shows up with a non-filtering generator. That re-filtering does not stop the ID token. - Other paths through the same raw value: beyond
create_granted_params(), we did not audit every scope read inprocess_implicit_token()(`authlib/oidc/core/grants/implicit.py:132-169`), or in other OIDC grants such as the hybrid grant. Whether they share the pattern is not verified. - Already safe, no change needed:
- the scope filtering in the parent
ImplicitGrantand inClientMixin UserInfoEndpoint, which rejects this client's access token with 403insufficient_scope- the OIDC authorization code flow, which issues no ID token for this client
Suggested regression test, alongside the existing Flask OIDC implicit-grant tests:
- Register a client with
scope='profile'andresponse_types=['id_token token']. - Send an authorization request with
scope=openid profileand anonce, and approve it. - Assert that the response is an
invalid_scopeerror ("Missing 'openid' scope") and that the redirect contains noid_token.
A second case should use a token generator that does not filter scope, and assert that the issued access token carries only the client's allowed scopes.
Questions
- Does CVE-2026-114619 let a client read user data without consent?
No. The user must log in and approve the request. The problem is that the consent page lists only the filtered scope, so the user is not shown that an ID token with their identity will be issued.
- Is the authorization code flow affected?
No. The report says that flow issued no ID token for the same client. Only deployments registering OpenIDImplicitGrant are affected.
- What fixes it?
authlib 1.9.0, via pull request 945. All versions below 1.9.0 are listed as vulnerable, though the reporter tested only v1.8.0.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-114614
Authlib: is_secure_transport() loopback exemption can be bypassed with a userinfo component, allowing cleartext-HTTP URLs to non-loopback hosts
low2.6Oct 27, 2026CVE-2026-114615
Authlib incomplete algorithm-confusion fix permits HMAC forgery with prefixed public keys
high7.4Oct 27, 2026CVE-2026-114617
Authlib: ID token can disable its own nonce validation via the nonce_supported claim
medium4.2Oct 27, 2026CVE-2026-114618
Authlib: Default JWT bearer grant accepts assertions for the wrong audience
medium6.8Oct 27, 2026CVE-2026-114620
Authlib: Unvalidated request_uri fetch in JWT-secured authorization request (JAR) leading to SSRF
medium5.4Oct 27, 2026CVE-2026-96760
Authlib: empty signatures validation in JWS JSON deserialization
critical9.1Oct 27, 2026
