Issue metadata
Sign in to add a comment
|
Security: CSP-bypass. 302 bypasses paths
Reported by
kidd...@gmail.com,
Jul 22 2016
|
||||||||||||||||||||||
Issue descriptionVULNERABILITY 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!
,
Jul 22 2016
,
Jul 22 2016
,
Jul 22 2016
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.
,
Oct 29 2016
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 |
|||||||||||||||||||||||
Comment 1 by kidd...@gmail.com
, Jul 22 201627.4 KB
27.4 KB View Download