Before reporting an issue
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
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-with with parameter type username
- Attach a
ParameterizedScopeUserPropertyMapper that maps the target user's email to a token claim shared_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_email claim
Anything else?
No response
Before reporting an issue
Area
core
Describe the bug
The
ParameterizedScopeUserPropertyMapperresolves 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 theview-usersrole, without fine-grained admin permissions, and without the target user's consent.The
usernamescope 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
Version
Any version with the
parameterized-scopes(formerlydynamic-scopes) feature enabled that includes theusernamescope type (26.7.0+).Regression
Expected behavior
The
ParameterizedScopeUserPropertyMappershould check that the authenticated user hasview-users/manage-userspermission on therealm-managementclient (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 (viaParameterizedScopeMapper) can still appear in the token, since the username string was already validated by the scope type.This is consistent with the
DelegationScopeType, which checkscanImpersonate()viaAdminPermissions.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 (
getUserByUsernamereturns non-null).How to Reproduce?
--features=parameterized-scopesshare-withwith parameter typeusernameParameterizedScopeUserPropertyMapperthat maps the target user'semailto a token claimshared_user_emailview-users)scope=openid share-with:aliceshared_user_emailclaimAnything else?
No response