Using Nonces and Hashes in CSP

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

MetricPoints Team
September 2, 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:

Follow the MetricPoints build

Occasional emails when we publish a new guide or ship something agencies can use: new monitoring checks, lessons from real client-site failures, and product updates. No fixed schedule. Unsubscribe anytime.

Tags

Nonces Hashes Inline Advanced

Related Articles