🔒 oidc: fix scope accumulation in loadExistingGrant - #1988
Open
douglasduteil wants to merge 1 commit into
Open
Conversation
douglasduteil
force-pushed
the
douglasduteil/oidc-fix-scope-accumulation-in-loadExistingGrant
branch
from
June 11, 2026 14:55
f5a53aa to
ee34215
Compare
**Problem** `addOIDCScope` and `addOIDCClaims` are additive — scopes from prior authorization requests (e.g. `organization`, `siret`) were retained on the existing grant even when a subsequent request no longer included them. This caused affiliation data (employer label, SIRET) to leak to clients that no longer requested the `organization` scope. **Proposal** Always create a fresh grant so scopes/claims reflect exactly what the current request asks for. The existing grant is still looked up, but only to preserve its expiry and keep it aligned with the session TTL.
douglasduteil
force-pushed
the
douglasduteil/oidc-fix-scope-accumulation-in-loadExistingGrant
branch
from
June 17, 2026 08:12
ee34215 to
4e907ef
Compare
Contributor
|
@douglasduteil, I wanted to add tests for scenarios that were used to implement Scenario 1The user is not prompted for consent:
Scenario 2
This issue is described here: panva/node-oidc-provider#1202 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
addOIDCScopeandaddOIDCClaimsare additive — scopes from priorauthorization requests (e.g.
organization,siret) were retained onthe existing grant even when a subsequent request no longer included
them. This caused affiliation data (employer label, SIRET) to leak to
clients that no longer requested the
organizationscope.Proposal
Always create a fresh grant so scopes/claims reflect exactly what the
current request asks for. The existing grant is still looked up, but
only to preserve its expiry and keep it aligned with the session TTL.