CSP blocks user-agent defined inline style – user agent should use stylesheet instead
Reported by
aidantwo...@gmail.com,
Jun 3 2016
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36 Example URL: https://www.aidanwoods.com/api/blog Steps to reproduce the problem: 1. Visit URL in which browser will style based on Content-Type, that also has a CSP policy disallowing inline styles 2. Open browser JS console/network requests 3. Observe that CSP violation has occurred resulting from UA behaviour What is the expected behavior? User-agent applied styling should be except from CSP violations (not necessarily true for extensions, but the browser defaults should be). Eg. chrome will allow its own user agent stylesheets to bypass CSP origin whitelist. What went wrong? Chrome's styling was applied with the expectation of unsafe-inline being allowed by CSP, or not set. Result is that unneeded CSP violation reports are sent to site owner. Does it occur on multiple sites: Yes Is it a problem with a plugin? No Did this work before? N/A Does this work in other browsers? No Safari 9.1.1 (likely prior verions too), OSX Chrome version: 50.0.2661.102 Channel: stable OS Version: OS X 10.11.5 Flash Version: Shockwave Flash 21.0 r0 Recommended action: use user-agent defined stylesheets to apply default styling when displaying non html content-type responses, using injected html from user agent.
,
Jun 6 2016
Removing Blink>CSS as this is down to CSP, not the CSS/Style engine.
,
Jun 6 2016
Just a remark on that: I'd think that the most sensible solution would be to move away from the inline style usage, rather than making changes to CSP. CSP really does do the correct thing by blocking inline style. And moving to stylesheet is an easy fix. As a reference, Firefox implements JSON formatting with stylesheet only.
,
Feb 14 2017
,
Nov 10 2017
,
Feb 18 2018
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by dtapu...@chromium.org
, Jun 3 2016