[
https://issues.apache.org/jira/browse/KNOX-3600?focusedWorklogId=1056063&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1056063
]
ASF GitHub Bot logged work on KNOX-3600:
----------------------------------------
Author: ASF GitHub Bot
Created on: 20/Nov/26 00:08
Start Date: 20/Nov/26 00:08
Worklog Time Spent: 10m
Work Description: smolnar82 merged PR #1531:
URL: https://github.com/apache/knox/pull/1531
Issue Time Tracking
-------------------
Worklog Id: (was: 1056063)
Time Spent: 1h (was: 50m)
> Prevent CLIENT_ID tokens from registering other clients
> -------------------------------------------------------
>
> Key: KNOX-3600
> URL: https://issues.apache.org/jira/browse/KNOX-3600
> Project: Apache Knox
> Issue Type: Improvement
> Components: KnoxIDF
> Reporter: Sandor Molnar
> Assignee: Sandor Molnar
> Priority: Critical
> Fix For: 3.1.0
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> *Problem*
> A registered client (a CLIENT_ID token with {{{}thirdPartyApp=true{}}})
> authenticates with its own client id as subject. Such a token can reach
> {{/knoxidf/api/v1/client/register}} this way: {{client_credentials}} at a
> server-managed topology, then a same-subject token exchange at a topology the
> registration topology trusts. The client then registers a new client owned by
> itself. That client gets its own {{knox.token.limit.per.user}} and can do the
> same, so the limit bounds nothing. Revoking the first client leaves all the
> clients it created working.
> *Fix*
> In {{{}RegistrationResource.registerClient{}}}, right after
> {{{}anonymousRegistrationDenied(){}}}: if the caller's subject is the id of a
> CLIENT_ID token, reject with {{access_denied}} and audit
> {{{}reason=client_caller_denied{}}}.
> * New KNOXIDF service param
> {{{}knoxidf.client.registration.client.callers.denied{}}}, default
> {{{}true{}}}. Setting {{false}} restores today's behaviour.
> * Check the raw subject ({{{}SubjectUtils.getPrimaryPrincipalName{}}}), not
> the effective principal. Identity-assertion mapping such as {{lowercase}}
> would hide a mixed-case user-supplied client id.
> * {{{}tokenStateService.getTokenMetadata(subject){}}}: reject if
> {{{}isClientId(){}}}. Unknown id: not a client.
> *Known limit*
> A deleted client's already-exchanged token passes until it expires, because
> its metadata is gone and it looks like a user.
> *Tests*
> * CLIENT_ID subject: rejected and audited. With the param set to
> {{{}false{}}}: registered.
> * User subject: registered.
> * Mixed-case client id under {{lowercase}} mapping: rejected.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)