Skip to content

Instantly share code, notes, and snippets.

View lweichselbaum's full-sized avatar

Lukas Weichselbaum lweichselbaum

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<title>Evil Site</title>
</head>
<body bgcolor="red">
<h2>Evil Site Demo</h2>
<!-- deduct via XSRF -->
<!DOCTYPE html>
<script src="https://secmetadata.appspot.com/api/xssi"> </script>
<!-- alert() will reveal the secret if the current browser doesn't support Fetch Metadata request headers. -->
<script>alert(secret)</script>
@lweichselbaum
lweichselbaum / FF_CSP_BUG.html
Last active June 16, 2018 11:11
Firefox CSP Bug - Dynamically created script with correct nonce gets blocked because of redirect.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="script-src 'nonce-abcd1234'">
</head>
<body>
<script nonce='abcd1234'>
var s = document.createElement('script');
s.setAttribute('nonce', 'abcd1234');
s.src = 'https://goo.gl/jEH8zk'; // redirects to jquery.