← Back to release summary

CSP: `script-src-attr`, `script-src-elem`, `style-src-attr`, `style-src-elem` directives

Category
Security
Type
New or changed feature
Status
Enabled by default (Chrome 75)
Intent stage
Prepare to ship

WPT details: https://wpt.fyi/results/content-security-policy/script-src-attr-elem?label=master&product=chrome%5Bexperimental%5D&product=edge&product=firefox%5Bexperimental%5D&product=safari%5Bexperimental%5D&aligned https://wpt.fyi/results/content-security-policy/script-src-attr-elem?label=master&product=chrome%5Bexperimental%5D&product=edge&product=firefox%5Bexperimental%5D&product=safari%5Bexperimental%5D&aligned

Summary

These 4 new directives provide the functionality of the script/style directive but with more granularity, applying to elements or attributes.

Standards & signals

Ecosystem

Docs: https://w3c.github.io/webappsec-csp/#directive-script-src-attr https://w3c.github.io/webappsec-csp/#directive-script-src-elem https://w3c.github.io/webappsec-csp/#directive-style-src-attr https://w3c.github.io/webappsec-csp/#directive-style-src-elem

Explainers: https://docs.google.com/document/d/1_nYS4gWYO2Oh8rYDyPglXIKNsgCRVhmjHqWlTAHst7c/edit?usp=sharing%20(the%20%22Directives%20specific%20for%20script%20and%20style%20attributes%20and%20elements%20(option%202)%22%20section%20in%20particular)

View on chromestatus.com