Browse Source

Fix more reflective XSS issues

Jordi Boggiano 8 years ago
parent
commit
dbcfd5cb41
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/Packagist/WebBundle/Resources/public/js/search.js

+ 4 - 0
src/Packagist/WebBundle/Resources/public/js/search.js

@@ -6,6 +6,10 @@ document.getElementById('search_query_query').addEventListener('keydown', functi
 
 var searchParameters = {};
 
+if (decodeURI(location.search).match(/[<>]/)) {
+    location.replace(location.pathname);
+}
+
 if (algoliaConfig.tags) {
     searchParameters.disjunctiveFacets = ['tags'];
     searchParameters.disjunctiveFacetsRefinements = {