[ 
https://issues.apache.org/jira/browse/WW-5710?focusedWorklogId=1041217&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1041217
 ]

ASF GitHub Bot logged work on WW-5710:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Sep/26 16:49
            Start Date: 13/Sep/26 16:49
    Worklog Time Spent: 10m 
      Work Description: sonarqubecloud[bot] commented on PR #1932:
URL: https://github.com/apache/struts/pull/1932#issuecomment-5654647082

   ## [![Quality Gate 
Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png
 'Quality Gate 
Passed')](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1932) 
**Quality Gate passed**  
   Issues  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [2 New 
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1932&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png
 '') [0 Accepted 
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1932&issueStatuses=ACCEPTED)
   
   Measures  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_struts&pullRequest=1932&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [100.0% Coverage on New 
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1932&metric=new_coverage&view=list)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0.0% Duplication on New 
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1932&metric=new_duplicated_lines_density&view=list)
  
     
   <!

Issue Time Tracking
-------------------

    Worklog Id:     (was: 1041217)
    Time Spent: 20m  (was: 10m)

> Allowlist priming targets the ModelDriven model even when the parameter was 
> authorised on the action
> ----------------------------------------------------------------------------------------------------
>
>                 Key: WW-5710
>                 URL: https://issues.apache.org/jira/browse/WW-5710
>             Project: Struts 2
>          Issue Type: Task
>          Components: Core
>            Reporter: Lukasz Lenart
>            Priority: Major
>             Fix For: 7.4.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> {{ParametersInterceptor.isParameterAnnotatedAndAllowlist}} resolves the 
> binding target once and uses it for both steps:
>     Object target = parameterAuthorizer.resolveTarget(action);
>     if (!parameterAuthorizer.isAuthorized(name, target, action)) {
>         return false;
>     }
>     parameterAllowlister.primeAllowlistForPath(name, target);
> For a ModelDriven action, {{resolveTarget}} returns the model. Since WW-5698, 
> {{isAuthorized}} may authorise a parameter against a member declared on the 
> *action* rather than on the model — that is the whole point of scoping the 
> exemption. The subsequent {{primeAllowlistForPath}} call still primes against 
> the model, so for such a parameter the classes along the path are never added 
> to the {{ThreadAllowlist}}.
> With {{struts.allowlist.enable=true}}, the effect is that a correctly 
> {{@StrutsParameter}}-annotated nested property on a ModelDriven action's own 
> class is authorised and then dropped by the allowlist. It fails closed, so 
> this is a functional bug rather than a security issue, but it is confusing to 
> diagnose: the annotation is present and correct, and nothing in the logs 
> points at the allowlist.
> h3. Suggested fix
> Prime against the object the authorisation was actually granted on — either 
> by having {{ParameterAuthorizer.isAuthorized}} report which object it 
> authorised against, or by priming against both the model and the action on 
> the ModelDriven path.
> Found while reviewing WW-5698 / PR 
> [#1872|https://github.com/apache/struts/pull/1872].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to