Hello,
I am a frontend developer. My team is currently implementing CSP with nonces. As per security standards, a nonce must be generated dynamically for every request, which I had successfully implemented. However, our frontend lead decided to generate the nonce statically during the build pipeline. This is the exact opposite of a secure CSP implementation.
Could you please implement a security mechanism to block or warn about pages that repeat the same nonce on every request? This would help developers like me force our teams to adopt the correct, secure solution.
Here is a proposal on how this could be approached at the browser engine level:
Problem Statement: Generating CSP nonces statically during the CI/CD build pipeline creates a false sense of security, entirely neutralizing the XSS mitigation that the CSP specification is designed to provide.
Proposed Solution: I propose implementing a strict security check within the browser engine to detect predictable, static, or heavily cached nonces. Specifically:
DevTools Violation: Trigger a severe security warning in the console if a page containing a CSP nonce is served with aggressive caching headers (e.g., missing Cache-Control: no-cache or no-store ), as this inherently implies the nonce is being reused.
Enforcement: Introduce a mechanism to track nonce entropy or reuse across hard reloads for the same origin. If a static nonce is detected, the browser should disregard it, thereby blocking the inline scripts and forcing development teams to fix the implementation.
Impact: Implementing this strict validation at the browser level will force technical leads and engineering teams to adopt correct dynamic nonce generation strategies, eliminating "placebo" CSP implementations across the web.
... View more