[
https://issues.apache.org/jira/browse/WW-5645?focusedWorklogId=1029646&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1029646
]
ASF GitHub Bot logged work on WW-5645:
--------------------------------------
Author: ASF GitHub Bot
Created on: 12/Jul/26 17:02
Start Date: 12/Jul/26 17:02
Worklog Time Spent: 10m
Work Description: arunmanni-ai commented on PR #1777:
URL: https://github.com/apache/struts/pull/1777#issuecomment-4952020874
Thanks again — pushed two commits addressing points 1, 3, and the Locale
import part of 4 (per-segment matching in
containsMalformedPathSegment, and removed the now-redundant dot-checkin
DefaultWebJarUrlProvider.split()).
Still to follow in one more commit:
- Small indentation cleanup and removing the now-unused `encoding` field
(rest of point 4)
- Replacing the denylist with a canonicalize approach (point 2) — taking a
bit more care with this one since it also means wiring the resolved path
through buildPath()/split() rather than just validating and discarding it, so
it'll take a little longer to get right.
Will update this thread once that's up.
Issue Time Tracking
-------------------
Worklog Id: (was: 1029646)
Time Spent: 20m (was: 10m)
> Remove redundant URL decode and harden path handling in static content serving
> ------------------------------------------------------------------------------
>
> Key: WW-5645
> URL: https://issues.apache.org/jira/browse/WW-5645
> Project: Struts 2
> Issue Type: Improvement
> Components: Core
> Affects Versions: 7.2.1
> Reporter: Arun Manni
> Priority: Minor
> Fix For: 7.3.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> buildPath() in DefaultStaticContentLoader applies URLDecoder.decode() to
> resource paths that the servlet container has already decoded. This
> redundant decode serves no purpose and conflicts with the servlet spec's
> path handling contract.
> This patch removes the unnecessary decode, adds a shared
> Validator.containsMalformedPathSegment() utility that rejects malformed
> path segments (dot-dot sequences, backslash separators, and
> percent-encoded forms), applies it in both the static content and WebJar
> serving paths, documents the encoding contract on
> RequestUtils.getServletPath(), and adds test coverage.
> PR: https://github.com/apache/struts/pull/1777
--
This message was sent by Atlassian Jira
(v8.20.10#820010)