CSP hash sources
Authorises exact inline script or style content through cryptographic source expressions.
Support in current browsers
Checked against the current browser versions recorded in MDN browser data 8.0.7.
| Browser | Minimum | Outcome | Reason |
|---|---|---|---|
| Chrome | 150 | Not enough browser data | BCD 8.0.7 does not publish a standalone compatibility statement for CSP hash source expressions. |
| Edge | 150 | Not enough browser data | BCD 8.0.7 does not publish a standalone compatibility statement for CSP hash source expressions. |
| Firefox | 152 | Not enough browser data | BCD 8.0.7 does not publish a standalone compatibility statement for CSP hash source expressions. |
| Safari | 26.5 | Not enough browser data | BCD 8.0.7 does not publish a standalone compatibility statement for CSP hash source expressions. |
| Chrome for Android | 150 | Not enough browser data | BCD 8.0.7 does not publish a standalone compatibility statement for CSP hash source expressions. |
| Firefox for Android | 152 | Not enough browser data | BCD 8.0.7 does not publish a standalone compatibility statement for CSP hash source expressions. |
| Safari on iOS | 26.5 | Not enough browser data | BCD 8.0.7 does not publish a standalone compatibility statement for CSP hash source expressions. |
| Android WebView | 150 | Not enough browser data | BCD 8.0.7 does not publish a standalone compatibility statement for CSP hash source expressions. |
| Samsung Internet | 29.0 | Not enough browser data | BCD 8.0.7 does not publish a standalone compatibility statement for CSP hash source expressions. |
What this feature can and cannot do
Helps protect against
- Injected inline script execution
- Injected inline style execution
Does not guarantee
- Modified content without a matching policy update
- Unsafe external scripts
- Permitted code that creates dangerous sinks
What you need before using it
- Stable inline content
- A CSP source policy with matching digests
Fallback to keep in place
Use nonces or external resources under a restrictive CSP when hash maintenance is unsuitable.