[
https://issues.apache.org/jira/browse/WW-5504?focusedWorklogId=950949&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-950949
]
ASF GitHub Bot logged work on WW-5504:
--------------------------------------
Author: ASF GitHub Bot
Created on: 05/Jan/25 14:04
Start Date: 05/Jan/25 14:04
Worklog Time Spent: 10m
Work Description: assachs commented on PR #1174:
URL: https://github.com/apache/struts/pull/1174#issuecomment-2571637777
I'm not sure if i missed something.
In DefaultCSPSettings, when creating the poplicy format, the nonce is always
taken from the session
` return format(policyFormatBuilder.toString(),
**getNonceString(request));**
}
protected String getNonceString(HttpServletRequest request) {
Object nonce = **request.getSession().getAttribute(NONCE_KEY);**
return Objects.toString(nonce);
}`
Issue Time Tracking
-------------------
Worklog Id: (was: 950949)
Time Spent: 0.5h (was: 20m)
> CSP Nonce changes within a page
> -------------------------------
>
> Key: WW-5504
> URL: https://issues.apache.org/jira/browse/WW-5504
> Project: Struts 2
> Issue Type: Bug
> Components: Core Interceptors
> Affects Versions: 6.7.0
> Reporter: Andreas Sachs
> Priority: Major
> Fix For: 6.8.0, 7.1.0
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Sometimes the CSP nonce changes within a page.
>
> <script type="text/javascript" src="..." nonce="A"> </script>
> <script type="text/javascript" src="..." nonce="A"> </script>
> ...
> <script type="text/javascript" src="..." nonce="B"> </script>
>
> This happens if there are concurrent requests within the same session.
>
> Each request stores a new nonce in the session:
>
> DefaultCspSettings:
> request.getSession().setAttribute("nonce", nonceValue);
>
> If the first request is not finished, the second request will change the
> nonce of the first request.
>
>
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)