Skip to content
This repository was archived by the owner on May 25, 2023. It is now read-only.

Commit 4175032

Browse files
committed
SECURITY UPDATE: Fixed cross-site scripting issue in redirect result page.
Although setting HTML element content via innerHTML ignores script tags, it is possible to run arbitrary script code by using the onerror handler of img tags: result.html?<img src="foo.png" onerror="alert(document.cookie)"/> Setting the body content via textContent/innerText fixes this security hole. Thanks to Diederik van der Boor for the report and proof-of-concept.
1 parent fe29267 commit 4175032

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

cors/result.html

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE HTML>
22
<!--
33
/*
4-
* jQuery Iframe Transport Plugin Redirect Page 2.0
4+
* jQuery Iframe Transport Plugin Redirect Page 2.0.1
55
* https://github.com/blueimp/jQuery-File-Upload
66
*
77
* Copyright 2010, Sebastian Tschan
@@ -16,5 +16,9 @@
1616
<meta charset="utf-8">
1717
<title>jQuery Iframe Transport Plugin Redirect Page</title>
1818
</head>
19-
<body><script>document.body.innerHTML=decodeURIComponent(window.location.search.slice(1));</script></body>
20-
</html>
19+
<body>
20+
<script>
21+
document.body.innerText=document.body.textContent=decodeURIComponent(window.location.search.slice(1));
22+
</script>
23+
</body>
24+
</html>

0 commit comments

Comments
 (0)