New issue
Advanced search Search tips

Issue 860856 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Aug 27
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 2
Type: Bug-Security



Sign in to add a comment

Security: DevTools Network panel response preview does not honor header CSP

Reported by exhnoz...@gmail.com, Jul 7

Issue description

VULNERABILITY DETAILS
On a web page with a Content Security Policy, the CSP header is ignored in the response Preview on the DevTools Network panel. When the CSP is in a header, the images, stylesheets, and webfonts are requested and displayed as if there were no CSP. The CSP appears to be respected when it is in a meta tag (though displaying the preview seems to cause the thumbnail images from #860840 to reload).

VERSION
Chrome Version: 67.0.3396.99 stable
Operating System: Windows 10 Pro Version 1803 OS Build 17134.112

REPRODUCTION CASE
The preview only seems to load resources with full URLs, so that is an important part of reproducing this.
Run a local PHP development server with this command: php -S localhost:9999
Load http://localhost:9999/index.php with DevTools open to the Network panel.
See the text is not bold, and log.php has Status (blocked:csp) (and log.txt is empty).
Click index.php on the Network panel, then go to the Preview tab.
See the text is bold in the preview.
Open log.txt and see that a request was logged by log.php.

index.php:
<?php
    header("Content-Security-Policy: default-src 'none'");
?>
<!DOCTYPE html>
<link href="http://localhost:9999/log.php" rel="stylesheet">
This text should not be bold.

log.php:
<?php
file_put_contents('log.txt', var_export($_SERVER, true) . PHP_EOL, FILE_APPEND);
header('Cache-Control: no-cache, no-store, must-revalidate');
header('Content-Type: text/css');
?>
body {
	font-weight: bold;
}

log.txt:
[Empty file that log.php can write to]

 
Components: Blink>SecurityFeature
Cc: tsepez@chromium.org
+tsepez for thoughts/triage
Cc: paulir...@chromium.org pfeldman@chromium.org
Labels: Security_Severity-Low Security_Impact-Stable
Status: Untriaged (was: Unconfirmed)
CCing some devtools folks. It does seem to me that we should apply the policy delivered along with the preview to the previewed page. It's not clear to me what origin the preview runs in, though: is it rendered via a `data:` URL, for instance?
 Issue 860840  has been merged into this issue.
Does any JavaScript run when rendering a preview?
Project Member

Comment 6 by sheriffbot@chromium.org, Jul 10

Labels: Pri-2
As far as I can tell, no JavaScript runs in the preview.
Cc: dgozman@chromium.org
Components: -Blink>SecurityFeature Platform>DevTools>Network
re #c3: this preview is indeed rendered via `data:` URL. Does that disables CSP or some other features? Is of, I'll WontFix this issue since we do not aim for the perfect replica in preview.
Labels: OS-Chrome OS-Linux OS-Mac OS-Windows
Status: WontFix (was: Untriaged)
As per #9, wontfixing.
Project Member

Comment 12 by sheriffbot@chromium.org, Dec 4

Labels: -Restrict-View-SecurityTeam allpublic
This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment