CSP require-sri-for for scripts
- Category
- Security
- Type
- New or changed feature
- Status
- On hold (Chrome On hold)
- Intent stage
- None
WPT details: https://wpt.fyi/results/content-security-policy/tentative/require-sri-for?label=experimental&label=master&aligned
Summary
The `require-sri-for` directive gives developers the ability to assert that every resource of a given type needs to be integrity checked. If a resource of that type is attempted to be loaded without integrity metadata, that attempt will fail and trigger a CSP violation report. This intent covers the "script" value of this directive.
Motivation
Subresource-Integrity (SRI) enables developers to make sure the assets they intend to load are indeed the assets they are loading. But there's no current way for developers to be sure that all of their scripts are validated using SRI. The `require-sri-for` CSP directive would enable developers achieve that.
Standards & signals
- Specification: https://github.com/w3c/webappsec-subresource-integrity/pull/129
- Firefox: Positive
- Safari: Support
- Web developers: No signals
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=content-security-policy%2Ftentative%2Frequire-sri-for
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+CSP%20require-sri-for%20for%20scripts
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=CSP%20require-sri-for%20for%20scripts
- Baseline status: https://webstatus.dev/?q=CSP%20require-sri-for%20for%20scripts