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

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

                Author: ASF GitHub Bot
            Created on: 06/Oct/26 12:45
            Start Date: 06/Oct/26 12:45
    Worklog Time Spent: 10m 
      Work Description: sonarqubecloud[bot] commented on PR #1992:
URL: https://github.com/apache/struts/pull/1992#issuecomment-6016554078

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

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

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

> @StrutsParameter enforcement resolves accessor names differently from OGNL
> --------------------------------------------------------------------------
>
>                 Key: WW-5759
>                 URL: https://issues.apache.org/jira/browse/WW-5759
>             Project: Struts 2
>          Issue Type: Task
>          Components: Core
>            Reporter: Lukasz Lenart
>            Assignee: Lukasz Lenart
>            Priority: Major
>             Fix For: 7.5.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> {{StrutsParameterAuthorizer}} has to decide which accessor OGNL will go 
> through for a parameter name, and it derives that name differently from OGNL 
> in two places.
> h3. 1. Setters for names like {{uRange}} (OGNL 3.4.14 and later)
> OGNL 3.4.14 (orphan-oss/ognl#652, backport of #644) resolves 
> JavaBeans-compliant accessors: for a property {{uRange}} it tries 
> {{setuRange}} first and {{setURange}} second. {{findBindableAccessor}} only 
> looks for {{set}} plus the capitalised name, i.e. {{setURange}}.
> Two symptoms follow:
> * {{@StrutsParameter}} on {{setuRange}} has no effect: the parameter is 
> rejected (fails closed).
> * On a ModelDriven action, an unannotated {{setuRange}} on the action is not 
> seen as the action's own member, so the parameter takes the "declared on 
> neither the model nor the action" fallback and OGNL binds it through that 
> setter. The same family as WW-5709 (fluent setters).
> With OGNL 3.4.13, which Struts currently ships, OGNL never reaches 
> {{setuRange}}, so this only appears once OGNL is upgraded - by Struts or by 
> an application that overrides the OGNL version.
> h3. 2. Getters for nested parameters
> For a nested parameter the authorizer matches the {{java.beans}} property 
> name. {{Introspector}} names the property of {{getURL()}} {{URL}}, while OGNL 
> reaches {{getURL()}} for both {{uRL.host}} and {{URL.host}}. On a ModelDriven 
> action an unannotated {{getURL()}} on the action therefore also takes the 
> "declared on neither" fallback. This one is independent of the OGNL version.
> h3. Suggested fix
> Resolve accessors exactly the way OGNL does: try {{set}} (or {{is}} then 
> {{get}}) plus each accessor base name in OGNL's order, first match wins, and 
> normalise the root property with {{Introspector.decapitalize}} so the 
> candidate list matches OGNL's for the parameter name as written. Bump OGNL to 
> 3.4.14 in the same change.
> Found while upgrading to OGNL 3.5 (WW-5326).



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

Reply via email to