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

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

                Author: ASF GitHub Bot
            Created on: 06/Oct/26 12:52
            Start Date: 06/Oct/26 12:52
    Worklog Time Spent: 10m 
      Work Description: Copilot commented on code in PR #1992:
URL: https://github.com/apache/struts/pull/1992#discussion_r4195476609


##########
core/src/main/java/org/apache/struts2/interceptor/parameter/StrutsParameterAuthorizer.java:
##########
@@ -132,7 +134,7 @@ public boolean isAuthorized(String parameterName, Object 
target, Object action)
                     parameterName);
             return false;
         }
-        String normalisedRootProperty = 
Character.toLowerCase(rootProperty.charAt(0)) + rootProperty.substring(1);
+        String normalisedRootProperty = 
Introspector.decapitalize(rootProperty);

Review Comment:
   This change touches security-sensitive framework code. Please confirm it is 
not a fix for a suspected vulnerability before merging — see `SECURITY.md`. 
Vulnerability fixes go through the private process at 
`[email protected]`, not a public pull request.





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

    Worklog Id:     (was: 1045921)
    Time Spent: 40m  (was: 0.5h)

> @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: 40m
>  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