struts icon indicating copy to clipboard operation
struts copied to clipboard

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

Open lukaszlenart opened this issue 10 months ago • 3 comments

WW-5504

lukaszlenart avatar Jan 05 '25 13:01 lukaszlenart

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

assachs avatar Jan 05 '25 14:01 assachs

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

lukaszlenart avatar Jan 05 '25 16:01 lukaszlenart

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

sonarqubecloud[bot] avatar Jan 05 '25 16:01 sonarqubecloud[bot]

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

sonarqubecloud[bot] avatar Sep 07 '25 08:09 sonarqubecloud[bot]