[
https://issues.apache.org/jira/browse/WW-5642?focusedWorklogId=1030313&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1030313
]
ASF GitHub Bot logged work on WW-5642:
--------------------------------------
Author: ASF GitHub Bot
Created on: 14/Jul/26 12:57
Start Date: 14/Jul/26 12:57
Worklog Time Spent: 10m
Work Description: g0w6y commented on PR #1774:
URL: https://github.com/apache/struts/pull/1774#issuecomment-4969396460
Addressed all three notes in 3b184bf.
Added the array creator param test (testArrayOfRecordsAsCreatorParam) with a
WithArray fixture, so the collection matrix now covers List, Map and array.
Also added the two clarifying comments you suggested: one in
AuthorizingValueDeserializer noting that a redacted primitive component falls
back to the type default when FAIL_ON_NULL_FOR_PRIMITIVES is off, and one in
RedactionAwareDeserializer noting that a redaction co located with an unrelated
mapping error is folded into object dropped as a deliberate fail closed choice.
Full ParameterAuthorizingModuleTest suite passes locally (24 tests). This
change lives in the REST Jackson plugin and is independent of the JSON plugin
per request refactor in #1782, so it can land on its own. Ready whenever you
are.
Issue Time Tracking
-------------------
Worklog Id: (was: 1030313)
Time Spent: 1.5h (was: 1h 20m)
> @StrutsParameter authorization bypassed for record/creator-bound REST body
> properties
> -------------------------------------------------------------------------------------
>
> Key: WW-5642
> URL: https://issues.apache.org/jira/browse/WW-5642
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - REST
> Affects Versions: 7.2.1
> Environment: Reproducible with struts2-rest-plugin,
> struts.parameters.requireAnnotations
> enabled, and any REST action whose request body binds a Java record
> (or @JsonCreator/@ConstructorProperties type) either at the top level
> or nested. JDK 17, Jackson 2.22.0.
> Reporter: Gouri Sankar A
> Priority: Major
> Fix For: 7.3.0
>
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> ParameterAuthorizingModule enforces @StrutsParameter on REST/JSON body
> deserialization by wrapping each Jackson property's deserializeAndSet /
> deserializeSetAndReturn (AuthorizingSettableBeanProperty). Jackson never
> calls either method for creator-bound properties — Java records,
> @JsonCreator constructors, @ConstructorProperties — it calls the final
> SettableBeanProperty#deserialize directly, which the existing wrapper
> cannot intercept.
> With struts.parameters.requireAnnotations enabled, any record-typed
> field in a REST action's request body is populated with no
> @StrutsParameter check at all, silently defeating the protection for
> that entire subtree.
> Fix: wrap the property's value deserializer (the only non-final
> interception point for the creator-bound path), scoped to
> CreatorProperty so existing setter/field/builder paths are unaffected.
> Fixed by: https://github.com/apache/struts/pull/1774
--
This message was sent by Atlassian Jira
(v8.20.10#820010)