Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WW-5504 Allows to use request instead of session attribute to store nonce #1174

Draft
wants to merge 2 commits into
base: release/struts-6-7-x
Choose a base branch
from

Conversation

lukaszlenart
Copy link
Member

@assachs
Copy link
Contributor

assachs commented Jan 5, 2025

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);
}`

@lukaszlenart
Copy link
Member Author

Thanks, fixed! Yet I'm not sure if this is a proper way to do it

@lukaszlenart lukaszlenart force-pushed the feature/WW-5504-request-nonce branch from a4875fd to f4c581d Compare January 5, 2025 16:33
Copy link

sonarqubecloud bot commented Jan 5, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
22 Security Hotspots
42.3% Coverage on New Code (required ≥ 80%)
3.4% Duplication on New Code (required ≤ 3%)
E Security Rating on New Code (required ≥ A)
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@lukaszlenart lukaszlenart added this to the 6.8.0 milestone Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants