Content Security Policy
Restricts the browser resources and execution paths that a document may use.
Support in current browsers
Checked against the current browser versions recorded in MDN browser data 8.1.5.
| Browser | Minimum | Outcome | Reason |
|---|---|---|---|
| Chrome | 155 | Works | Every required mapped BCD feature is available without a recorded qualification. |
| Edge | 154 | Works | Every required mapped BCD feature is available without a recorded qualification. |
| Firefox | 157 | Works | Every required mapped BCD feature is available without a recorded qualification. |
| Safari | 27 | Works | Every required mapped BCD feature is available without a recorded qualification. |
| Chrome for Android | 155 | Works | Every required mapped BCD feature is available without a recorded qualification. |
| Firefox for Android | 157 | Works | Every required mapped BCD feature is available without a recorded qualification. |
| Safari on iOS | 27 | Works | Every required mapped BCD feature is available without a recorded qualification. |
| Android WebView | 155 | Works | Every required mapped BCD feature is available without a recorded qualification. |
| Samsung Internet | 30.0 | Works | Every required mapped BCD feature is available without a recorded qualification. |
How support changed
Each segment groups recorded releases with the same result. Gaps between recorded versions are not filled in. This is support at each release, rather than the planner’s check of every release above a minimum.
Chrome
http.headers.Content-Security-Policy- 1 – 1313 recorded releasesNot supported
- Uses alternative name X-Webkit-CSP
- 14 – 2411 recorded releasesWorks with limits
- Uses alternative name X-Webkit-CSP
- 25 – 155130 recorded releasesWorks
Edge
http.headers.Content-Security-Policy- 12 – 132 recorded releasesNot supported
- 14 – 15480 recorded releasesWorks
Firefox
http.headers.Content-Security-Policy- 1 – 3.66 recorded releasesNot supported
- Uses alternative name X-Content-Security-Policy
- 4 – 2219 recorded releasesWorks with limits
- Uses alternative name X-Content-Security-Policy
- 23 – 157135 recorded releasesWorks
Safari
http.headers.Content-Security-Policy- 1 – 5.110 recorded releasesNot supported
- Uses alternative name X-Webkit-CSP
- 61 recorded releaseWorks with limits
- Uses alternative name X-Webkit-CSP
- 7 – 2750 recorded releasesWorks
Chrome for Android
http.headers.Content-Security-Policy- 181 recorded releaseWorks with limits
- Uses alternative name X-Webkit-CSP
- 25 – 155130 recorded releasesWorks
Firefox for Android
http.headers.Content-Security-Policy- 4 – 2216 recorded releasesNot supported
- 23 – 157125 recorded releasesWorks
Safari on iOS
http.headers.Content-Security-Policy- 1 – 57 recorded releasesNot supported
- Uses alternative name X-Webkit-CSP
- 61 recorded releaseWorks with limits
- Uses alternative name X-Webkit-CSP
- 7 – 2750 recorded releasesWorks
Android WebView
http.headers.Content-Security-Policy- 1 – 46 recorded releasesNot supported
- Uses alternative name X-Webkit-CSP
- 4.4 – 155120 recorded releasesWorks
Samsung Internet
http.headers.Content-Security-Policy- 1.01 recorded releaseWorks with limits
- Uses alternative name X-Webkit-CSP
- 1.5 – 30.051 recorded releasesWorks
BCD 8.1.5 · catalogue 2.3.0. Source corrections can change this trace without a new browser release.
What this feature can and cannot do
Helps protect against
- Content injection
- Cross-site scripting
- Untrusted embedding
Does not guarantee
- Unsafe application logic already permitted by the policy
- Server-side injection
- Complete prevention of browser implementation defects
What you need before using it
- A policy designed and tested for the application
Fallback to keep in place
Keep output encoding, input handling, dependency review, and other application controls in place.