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

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

                Author: ASF GitHub Bot
            Created on: 09/May/26 17:50
            Start Date: 09/May/26 17:50
    Worklog Time Spent: 10m 
      Work Description: sonarqubecloud[bot] commented on PR #1681:
URL: https://github.com/apache/struts/pull/1681#issuecomment-4413185100

   ## [![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=1681) 
**Quality Gate passed**  
   Issues  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0 New 
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1681&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=1681&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=1681&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [85.7% Coverage on New 
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1681&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=1681&metric=new_duplicated_lines_density&view=list)
  
     
   <!

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

    Worklog Id:     (was: 1019508)
    Time Spent: 0.5h  (was: 20m)

> CookieInterceptor bypasses @StrutsParameter authorization
> ---------------------------------------------------------
>
>                 Key: WW-5627
>                 URL: https://issues.apache.org/jira/browse/WW-5627
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Interceptors
>            Reporter: Lukasz Lenart
>            Assignee: Lukasz Lenart
>            Priority: Major
>             Fix For: 7.2.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> h2. Problem
>   
> {{CookieInterceptor.populateCookieValueIntoStack}} calls 
> {{stack.setValue(cookieName, cookieValue)}} directly 
> ({{CookieInterceptor.java}} lines 339 and 348), which:
> - bypasses {{StrutsParameterAuthorizer}} / {{@StrutsParameter}} enforcement,
> - never primes {{ThreadAllowlist}}.
>   
> Cookie injection therefore does not participate in the 
> parameter-authorization machinery that {{ParametersInterceptor}}, the JSON 
> plugin, and (post-[WW-5626|https://issues.apache.org/jira/browse/WW-5626]) 
> the REST plugin all share.
>   
> h2. Impact
> When {{cookiesName=*}} is configured, every public setter on the action — and 
> (subject to allowlist) any setter reachable through getter chains from the 
> value-stack root — is writeable from cookie input without any 
> {{@StrutsParameter}} opt-in. The OGNL allowlist (default {{enable=true}} 
> since 7.0) blocks the nested-bean route via {{SecurityMemberAccess}}, but it 
> does not require setters to be annotated with {{@StrutsParameter}}, so 
> action-level setters remain reachable.
> h2. Proposed fix
>   
> Replace {{stack.setValue}} in {{populateCookieValueIntoStack}} with 
> {{stack.setParameter}} (or invoke {{StrutsParameterAuthorizer}} directly) so 
> cookie injection participates in {{@StrutsParameter}} enforcement and 
> {{ThreadAllowlist}} priming, aligning {{CookieInterceptor}} with 
> {{ParametersInterceptor}}, the JSON plugin, and the REST plugin.
> h2. Dependencies
>   
> Builds on [WW-5626|https://issues.apache.org/jira/browse/WW-5626] — reuses 
> {{ParameterAuthorizationContext}} and {{ParameterAuthorizer.resolveTarget}}.
>   
> h2. Backward compatibility
>   
> Behavior change: apps relying on cookies populating un-annotated setters will 
> stop working under strict authorization. Affected users must either add 
> {{@StrutsParameter}} to the relevant setters or drop {{cookiesName=*}}. 
> Migration-guide entry required.



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

Reply via email to