Skip to content

Commit

Permalink
Merge pull request #29 from vikingco/bugfix/MVP-16063/extra-xss-preve…
Browse files Browse the repository at this point in the history
…ntion

Improve XSS protection
  • Loading branch information
fvoordeckers authored Nov 30, 2017
2 parents e9aa040 + 329eb1d commit ae1992b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion django_ajax/static/ajax-utilities/js/pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ var Pagination = new function() {

function ajax(url, handler) {
// URL should start with a slash, but cannot start with two slashes.
// we cannot start with "/\". Modern browsers handle backslashes as normal slashes.
// (Otherwise we have an XSS vulnerability.)
if (url[0] != '/' || url[1] == '/')
if (url[0] != '/' || url[1] == '/' || url.startsWith("/\\")
url = (''+location).replace( /[#\?].*/, '') + url;

// Append 'xhr' to make sure all content is loaded.
Expand Down

0 comments on commit ae1992b

Please sign in to comment.