[
https://issues.apache.org/jira/browse/WW-5713?focusedWorklogId=1040863&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1040863
]
ASF GitHub Bot logged work on WW-5713:
--------------------------------------
Author: ASF GitHub Bot
Created on: 11/Sep/26 08:05
Start Date: 11/Sep/26 08:05
Worklog Time Spent: 10m
Work Description: kuranikaran commented on PR #1890:
URL: https://github.com/apache/struts/pull/1890#issuecomment-5631383092
Implemented the approved redesign in `917ce740`.
The normal Tiles bootstrap no longer uses `DispatcherListener`. On the first
`OGNL:` evaluation, the evaluator resolves the Dispatcher from that request’s
`ServletContext`, reads `struts.tiles.ognl.legacy.enabled` once, and caches the
resulting delegate for its lifetime.
A missing Dispatcher, false or missing flag, or non-servlet request now
fails closed with the migration `EvaluationException`. The raw evaluator and
global `Request` accessor are constructed only after an application-local
explicit opt-in.
The public boolean constructors remain available for custom initializers.
Tiles validation passes with 561/561 tests, including per-webapp isolation,
cached resolution, non-servlet handling, construction gating, concurrency, and
unchanged `S2:` behavior.
The new GitHub Actions runs are awaiting repository approval.
Issue Time Tracking
-------------------
Worklog Id: (was: 1040863)
Time Spent: 50m (was: 40m)
> Fail closed for legacy Tiles OGNL evaluation
> --------------------------------------------
>
> Key: WW-5713
> URL: https://issues.apache.org/jira/browse/WW-5713
> Project: Struts 2
> Issue Type: Improvement
> Components: Plugin - Tiles
> Reporter: Karan Kurani
> Priority: Major
> Fix For: 7.4.0
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> The Struts Tiles plugin registers separate {{S2:}} and legacy {{OGNL:}}
> attribute-expression evaluators.
> The {{S2:}} evaluator processes ValueStack expressions through the Struts
> OGNL facilities. The legacy {{OGNL:}} evaluator evaluates against the Tiles
> {{Request}} and does not use the Struts OGNL security controls used by
> {{{}S2:{}}}.
> This hardening change keeps {{OGNL:}} registered but makes it fail closed by
> default. Evaluation throws Tiles {{EvaluationException}} with migration
> guidance directing users to {{{}S2:{}}}.
> Applications that temporarily require the existing raw behavior may
> explicitly set:
> {{struts.tiles.ognl.legacy.enabled=true}}
> The compatibility flag defaults to {{false}} and is targeted for removal in
> Struts 8.0.0.
> The raw evaluator and its global {{OgnlRuntime}} {{Request}}
> property-accessor setup are constructed only when legacy mode is explicitly
> enabled. This avoids mutating the shared OGNL runtime for applications using
> the secure default.
> When legacy mode is enabled, the existing raw behavior is preserved and a
> clear startup migration warning is emitted.
> {{{}S2:{}}}, {{{}I18N:{}}}, and {{EL:}} remain unchanged.
> Tests cover:
> * default fail-closed behavior;
> * exact migration guidance;
> * non-evaluation of expression markers;
> * construction gating;
> * absence of global accessor initialization under the default;
> * explicit legacy compatibility behavior;
> * startup warning behavior; and
> * real servlet-backed {{S2:}} evaluation.
> This is defense-in-depth hardening. No attacker-controlled expression source
> or concrete vulnerability impact has been demonstrated, and no security
> advisory is proposed.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)