Merge pull request #2932 from coreos-inc/joseph.schorr/QS-81/xss-fix

Fix XSS in access token display page
This commit is contained in:
josephschorr 2017-12-06 13:49:37 -05:00 committed by GitHub
commit a1595cd723
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,23 +4,24 @@
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.no-icons.min.css">
<link href='//fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'>
<script type="text/javascript">
function setToken() {
var hash = document.location.hash.substr(1);
var pairs = hash.split('&');
for (var i = 0; i < pairs.length; ++i) {
var pair = pairs[i];
var kv = pair.split('=');
if (kv[0] == 'access_token') {
document.getElementById('accesstoken').appendChild(document.createTextNode(kv[1]));
}
}
}
</script>
</head>
<body>
<body onload="setToken()">
<div class="container" style="margin-top: 20px">
<img src="/static/img/quay-logo.png">
<h5>Access Token:
<script type="text/javascript">
var hash = document.location.hash.substr(1);
var pairs = hash.split('&');
for (var i = 0; i < pairs.length; ++i) {
var pair = pairs[i];
var kv = pair.split('=');
if (kv[0] == 'access_token') {
document.write(kv[1]);
}
}
</script>
</h5>
<h5>Access Token: <span id="accesstoken"></span></h5>
</div>
</body>
</html>