Repository navigation
Description
Before reporting an issue
- I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.
Area
core
Describe the bug
The ParameterizedScopeUserPropertyMapper resolves a username from a parameterized scope parameter and maps the target user's attributes (email, id, firstName, custom attributes, etc.) directly into the token — without checking whether the authenticated user has permission to view the target user's data.
When a client has a username-typed parameterized scope with this mapper attached, any authenticated user can extract profile attributes of any user in the realm — without the view-users role, without fine-grained admin permissions, and without the target user's consent.
The username scope type itself is not the issue — validating that a user exists is a legitimate use case (e.g., marking resources for sharing). The problem is that the mapper crosses the data boundary by resolving user attributes into the token without authorization.
Impact
- Information disclosure — a regular user can extract profile attributes (email, id, firstName, lastName, custom attributes) of any other user in the realm
- No consent from target — the target user never agreed to have their attributes exposed to the requesting user
- Extension risk — custom mappers built on similar patterns may replicate this gap; the built-in mapper should set the correct precedent
Version
Any version with the parameterized-scopes (formerly dynamic-scopes) feature enabled that includes the username scope type (26.7.0+).
Regression
- The issue is a regression
Expected behavior
The ParameterizedScopeUserPropertyMapper should check that the authenticated user has view-users / manage-users permission on the realm-management client (or a matching FGAP policy) before resolving the target user's attributes. Without permission, the user property claims should be suppressed — the scope itself and the raw parameter value (via ParameterizedScopeMapper) can still appear in the token, since the username string was already validated by the scope type.
This is consistent with the DelegationScopeType, which checks canImpersonate() via AdminPermissions.evaluator() before allowing delegation.
Actual behavior
The mapper unconditionally resolves the target user and writes their attributes into the token. The only check is whether the user exists (getUserByUsername returns non-null).
How to Reproduce?
- Enable
--features=parameterized-scopes - Create a parameterized client scope
share-withwith parameter typeusername - Attach a
ParameterizedScopeUserPropertyMapperthat maps the target user'semailto a token claimshared_user_email - Assign the scope as optional to a client
- Authenticate as a regular user (no admin roles, no
view-users) - Request
scope=openid share-with:alice - Inspect the access token — it contains Alice's email address in the
shared_user_emailclaim
Anything else?
No response
Metadata
Metadata
Assignees
Labels
Type
Fields
Projects
- StatusShow more project fieldsDone
Activity
[-]Username parameterized scope type does not check view permissions[/-][+]Parameterized UserPropertyMapper exposes target user attributes without permission check[/+]12 remaining items
Parameterized UserPropertyMapper exposes target user attributes witho…