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

Issue 630602 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Buried. Ping if important.
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: ----
Type: Bug-Security



Sign in to add a comment

Security: CSP-bypass. 302 bypasses paths

Reported by kidd...@gmail.com, Jul 22 2016

Issue description

VULNERABILITY DETAILS
It's possible to bypass whitelisted paths in CSP by issuing a 302 to a non-whitelisted path.

VERSION
Chrome Version: Version 54.0.2803.0 canary (64-bit)
Operating System: Windows 10 Pro 


Steps to reproduce:

1. Create a page: example.com/foo/bar/poc.php
2. poc.php will have a "Location"-header to example2.com/notwhitelisted/poc.jpg
3. Create a CSP with: "img-src example.com/foo/bar/ example2.com/foo/"
4. Create a page with the HTML <img src="https://example.com/foo/bar/poc.php"/>
5. https://example.com/foo/bar/poc.php will load from example2.com/notwhitelisted/poc.jpg

As you see above, the path "/notwhitelisted/" is not listed as valid in the CSP, still the 302 can get the image from there. If we try to show the image directly (via img src) it will not be shown!  

Full working Poc: https://headersandbox.herokuapp.com/#&content-security-policy=img-src swehack.org/img/a.php s.chloe.re/foo/test/bar/hello.jpg&html=PGltZyBzcmM9Imh0dHBzOi8vc3dlaGFjay5vcmcvaW1nL2EucGhwIi8+CjxpbWcgc3JjPSJodHRwczovL3MuY2hsb2UucmUvZm9vL2EuanBnIi8+Cg==


My thoughts: yes, "example.com/foo/bar/" is whitelisted, but it should not be allowed to control the paths of other whitelisted directives. Open redirects vulnerabilities would bypass CSP if the CSP uses paths. 


Thank you! 
 
8x6aF1e.png
6.9 KB View Download
h5l605k.png
364 KB View Download

Comment 1 by kidd...@gmail.com, Jul 22 2016

Here's a picture of the CSP
eDfsIVr.png
27.4 KB View Download
Cc: jww@chromium.org
Owner: mkwst@chromium.org
Components: Blink>SecurityFeature

Comment 4 by est...@chromium.org, Jul 22 2016

Labels: -Restrict-View-SecurityTeam
Status: WontFix (was: Unconfirmed)
Hi, thanks for the report. While unintuitive, this is working as intended, to prevent leaking cross-origin paths after redirects.

See  issue 452821 , https://www.w3.org/TR/CSP2/#source-list-paths-and-redirects, and https://lists.w3.org/Archives/Public/public-webappsec/2014Feb/0036.html for more discussion.
Project Member

Comment 5 by sheriffbot@chromium.org, Oct 29 2016

Labels: 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