Summary
An OIDC userinfo endpoint may return identity claims without checking whether the presented API token has scopes authorizing access to those claims. An attacker with a valid but insufficiently privileged token could obtain personal or account-related information that should be restricted by scope.
Affected context
This issue occurs in OIDC deployments where the userinfo endpoint accepts API or bearer tokens but does not enforce the scopes associated with those tokens before returning identity claims. The risk depends on the claims exposed, token issuance policies, and whether an attacker can obtain or reuse a token lacking the intended privileges.
Exploit preconditions
- Attack surface: OIDC userinfo endpoint
- Required access: A valid API or bearer token accepted by the endpoint
- Authorization condition: The token lacks scopes intended to authorize the returned identity claims
- Trigger point: A userinfo request that is processed without effective scope enforcement
- Why exploitation is possible: The endpoint treats token validity as sufficient authorization and returns claims beyond the token's permitted scope
Why this happens
The underlying flaw is an authorization failure in which authentication and token validity are checked without applying the token's scope restrictions to the requested identity data. This maps to CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, because the endpoint can disclose identity claims to a caller who is authenticated but not authorized to receive them.
Potential impact
- Exposure of personal, profile, email, or account identity claims
- Privacy violations and increased risk of targeted social engineering
- Correlation of identities across applications or tenants
- Disclosure of information that could support account compromise or lateral attacks
- Regulatory, contractual, or reputational consequences
General mitigation guidance
Mitigation generally focuses on making authorization scope checks explicit and enforcing least privilege for every returned claim.
Common defensive patterns include:
- Validate required scopes before processing each userinfo response
- Return only claims authorized by the token and the relying-party policy
- Use secure-by-default claim allowlists rather than broad identity payloads
- Reduce trust in token presence alone; distinguish authentication from authorization
- Minimize sensitive claims and apply tenant and audience restrictions
- Apply consistent authorization middleware across all OIDC endpoints
- Avoid revealing claim data in errors, logs, or fallback responses
How teams detect issues like this
Organizations can identify this class of issue through:
- Static and semantic analysis that checks userinfo responses against token scopes
- Code review signals such as token validation without claim-level authorization
- Tests using valid tokens with missing, partial, expired, or unrelated scopes
- Policy checks requiring explicit scope-to-claim mappings
- Integration tests covering tenant, audience, and claim minimization rules
- Monitoring for successful userinfo requests that return claims beyond the token's granted permissions

