[ 
https://issues.apache.org/jira/browse/WW-5504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17908077#comment-17908077
 ] 

Andreas Sachs commented on WW-5504:
-----------------------------------

I think of two possibilities:
 * only set a nonce if there isn't a nonce in the session (maybe not a good 
idea with long living sessions)
 * use request attributes instead of session attributes

A already tried the second one (changes in DefaultCspSettings and UIBean): i 
had to change my own component from session to request attributes, but it 
worked, as far as i can see. 

> 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.7.1
>
>
> 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)

Reply via email to