[
https://issues.apache.org/jira/browse/WW-5618?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18138022#comment-18138022
]
Lukasz Lenart commented on WW-5618:
-----------------------------------
Credit: the limits added in this ticket (PRs #1625 and #1626) were prompted in
part by Daniel Owens's Full Disclosure post "JSON Deserialiser Unconstrained
Resource Consumption Quick Overview" (2026-03-07):
https://seclists.org/fulldisclosure/2026/Mar/6
Thanks to Daniel for the write-up. This acknowledgement should have been
recorded when the ticket was filed.
> Make JSON plugin more configurable
> ----------------------------------
>
> Key: WW-5618
> URL: https://issues.apache.org/jira/browse/WW-5618
> Project: Struts 2
> Issue Type: Improvement
> Components: Plugin - JSON
> Reporter: Lukasz Lenart
> Assignee: Lukasz Lenart
> Priority: Minor
> Fix For: 6.9.0, 7.2.1
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> The JSON plugin currently provides limited configuration options for
> controlling deserialization behavior. Other Struts components (e.g.,
> {{fileUpload}} interceptor) offer fine-grained, per-action configurable
> limits, but the JSON plugin has no equivalent controls.
> This ticket adds the following configurable options:
> - {{struts.json.maxElements}} — maximum number of elements in a single JSON
> array or object (default: 10,000)
> - {{struts.json.maxDepth}} — maximum nesting depth for JSON structures
> (default: 64)
> - {{struts.json.maxLength}} — maximum length of JSON input in characters
> (default: 2,097,152 / 2MB)
> - {{struts.json.maxStringLength}} — maximum length of an individual JSON
> string value (default: 262,144 / 256KB)
> - {{struts.json.maxKeyLength}} — maximum length of a JSON object key name
> (default: 512)
> These options should be:
> 1. Configurable globally via {{struts.xml}} constants
> 2. Overridable per-action via interceptor {{<param>}} elements (same pattern
> as {{fileUpload}})
> 3. Exposed through `JSONConstants` and {{JSONConstantConfig}}
> Additionally, {{JSONReader}} should be made injectable via the Struts
> Container (matching the existing {{JSONWriter}} pattern), allowing users to
> provide custom reader implementations.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)