Intent to Prototype: CSP require-sri-for

103 views
Skip to first unread message

Yoav Weiss (@Shopify)

unread,
Feb 5, 2025, 3:08:14 PMFeb 5
to blink-dev

Contact emails

yoav...@chromium.org

Explainer

Not yet

Specification

Not yet

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.



Blink component

Blink>SecurityFeature>ContentSecurityPolicy

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.



Initial public proposal

This revives an old I2I for the ~same API.

TAG review

Not yet

TAG review status

N/A

Risks



Interoperability and Compatibility

No particular compatibility concern. It's too early to discuss interop risks, but at worst, this directive would apply (voluntary) content restrictions which won't be applied in non-supporting browsers. So I wouldn't expect content to break in other browsers.


Gecko: No signal. Haven't asked yet.

WebKit: No signal. Haven't asked yet.

Web developers: No signals, but I suspect PCIv4 would make some developers interested in making sure their documents' scripts have complete integrity checks.

Other signals:

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

None



Is this feature fully tested by web-platform-tests?

Yes

Flag name on about://flags

None

Finch feature name

RequireSRIFor

Non-finch justification

None

Requires code in //chrome?

False

Estimated milestones

No milestones specified



Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5090023365672960?gate=5197803019829248

This intent message was generated by Chrome Platform Status.
Reply all
Reply to author
Forward
0 new messages