Permalink
Browse files

fixed xss bug

  • Loading branch information...
mustardamus committed Jan 13, 2012
1 parent 55f271d commit d2137529539dd50e519d12a58fc1936d9a9fceb5
Showing with 19 additions and 12 deletions.
  1. +3 −2 index.html
  2. BIN jqapi-latest.zip
  3. +8 −2 js/main.js
  4. +8 −8 js/main.min.js
View
@@ -58,7 +58,7 @@ <h2><span class="name">Why another jQuery Documentation?</span><span class="retu
<div class="entry">
<h2><span class="name">jQAPI offline version</span><span class="returns">Documentation for the road.</span></h2>
<div class="longdesc">
- <p><a href="jqapi-latest.zip">Download HTML Version</a>. Documentation for jQuery version 1.7 - 1.8MB - 11/04/11</p>
+ <p><a href="jqapi-latest.zip">Download HTML Version</a>. Documentation for jQuery version 1.7 - 1.8MB - 01/13/12</p>
<p><a href="http://github.com/downloads/erikzaadi/jqapi/jQAPI-1.6.air?v=05182011">Download AIR Version</a>. Documentation for jQuery version 1.6 - 1.6MB - 05/18/11</p>
</div>
</div>
@@ -123,7 +123,8 @@ <h2><span class="name">To Do</span><span class="returns">What is still on the li
<div class="entry">
<h2><span class="name">Changelog</span><span class="returns">jQAPI history.</span></h2>
<div class="longdesc">
-<pre><code>[11/04/11] Updated Documentation for jQuery 1.7
+<pre><code>[01/13/12] Fixed XSS bug found by <a href="http://twitter.com/bulkneets">bulkneets</a> (<a href="https://twitter.com/#!/bulkneets/status/156620076160786432">Tweet</a>).
+[11/04/11] Updated Documentation for jQuery 1.7
Updated to jQuery 1.7
Added license information
No way! Valid HTML!
View
Binary file not shown.
View
@@ -98,9 +98,15 @@ jqapi = function() {
});
$(window).bind('hashchange', function(event) {
- var state = event.getState();
+ var state = event.getState(),
+ hasMarkup = /(<([^>]+)>)/ig.test(state.p);
- if(state.p) loadPage($('.sub a[href*="/' + state.p + '/"]:first'));
+ //defeat html xss insertion like #p=<img src%3D/%20onerror%3Dalert(1)>
+ //see https://twitter.com/#!/bulkneets/status/156620076160786432
+
+ if(state.p && !hasMarkup) {
+ loadPage($('.sub a[href*="/' + state.p + '/"]:first'));
+ }
}).trigger('hashchange');
zebraItems(elements.list); //zebra the items in the static list
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit d213752

Please sign in to comment.