Advanced Topics 14 min read

Using Nonces and Hashes in CSP

Advanced techniques for using nonces and hashes to allow inline scripts and styles securely.

MetricPoints Team
April 5, 2025

Understanding Nonces and Hashes

Nonces and hashes provide secure ways to allow specific inline scripts and styles while maintaining CSP protection.

Using Nonces

script-src 'self' 'nonce-{random-nonce}';

Nonces are random values that change with each page load, allowing specific inline content:

Tags

Nonces Hashes Inline Advanced

Related Articles