New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 897982 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Content-Security-Policy violation for JSON endpoints

Reported by ch...@cmbuckley.co.uk, Oct 22

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36

Example URL:
https://scripts.cmbuckley.co.uk/csp/json.php

Steps to reproduce the problem:
Load URL above, or serve the following PHP script:

<?php
header("Content-Security-Policy: default-src 'self'");
header('Content-Type: application/json');
?>{}

What is the expected behavior?
The styling for the JSON output are applied without displaying the error.

What went wrong?
The message in the console:

> Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'self'".

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 (11.1.2)

Chrome version: 69.0.3497.100  Channel: stable
OS Version: OS X 10.11.6
Flash Version:
 
Labels: Needs-Triage-M69
Cc: phanindra.mandapaka@chromium.org
Labels: Target-72 M-72 FoundIn-71 FoundIn-70 FoundIn-72 OS-Linux OS-Windows
Status: Untriaged (was: Unconfirmed)
chris@ Thanks for filling the issue...

Able to reproduce the issue on reported chrome version 69.0.3497.100 also on latest chrome 78.0.3588.0 using Mac 10.13.6, Ubuntu 14.04 and Windows 10.  
 
Same behavior is seen on M60(60.0.3112.113) hence considering it as non-regression and marking it as Untriaged.

Thanks..! 
I expect this is part of a wider class of problems, even without considering where extensions have to worry about CSPs...
Components: -Blink Blink>SecurityFeature>ContentSecurityPolicy
Owner: andypaicu@chromium.org
Status: Assigned (was: Untriaged)
looks like whatever we use to render raw json should disregard any csp header

Sign in to add a comment