[
https://issues.apache.org/jira/browse/WW-5752?focusedWorklogId=1045294&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1045294
]
ASF GitHub Bot logged work on WW-5752:
--------------------------------------
Author: ASF GitHub Bot
Created on: 02/Oct/26 01:23
Start Date: 02/Oct/26 01:23
Worklog Time Spent: 10m
Work Description: g0w6y commented on code in PR #1982:
URL: https://github.com/apache/struts/pull/1982#discussion_r4162054137
##########
core/src/main/java/org/apache/struts2/util/TokenHelper.java:
##########
@@ -133,7 +133,7 @@ public static String getToken(String tokenName) {
Parameter parameter = params.get(tokenName);
if (!parameter.isDefined()) {
- LOG.warn("Could not find token mapped to token name: {}",
tokenName);
+ LOG.warn("Could not find token mapped to token name: {}",
normalizeSpace(tokenName));
Review Comment:
Thanks, fixed in 9dee7a6. `validToken()` now logs
`normalizeSpace(tokenName)`, with a test for a token name containing a line
break and no matching token parameter.
Issue Time Tracking
-------------------
Worklog Id: (was: 1045294)
Time Spent: 0.5h (was: 20m)
> Normalize request-derived values in log messages
> -------------------------------------------------
>
> Key: WW-5752
> URL: https://issues.apache.org/jira/browse/WW-5752
> Project: Struts 2
> Issue Type: Bug
> Components: Core
> Affects Versions: 7.3.0
> Reporter: Gouri Sankar A
> Priority: Minor
> Fix For: 7.5.0
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Request-derived strings are logged unchanged at WARN level in several places,
> so a decoded line break (for example in a URL path, a parameter name, a
> request_locale value or a JSON key) produces forged log lines.
> Affected classes: DefaultActionMapper, RestfulActionMapper,
> ParametersInterceptor, DefaultLocaleProvider, JSONInterceptor,
> DefaultCspReportAction, TokenHelper.
> Proposed: apply StringUtils.normalizeSpace to these values, as TokenHelper,
> the multipart classes and ParametersInterceptor already do.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)