aels

Quick solution to fix last Opera UXSS vuln

Oct 11th, 2012
172
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (window.opera) {
  2.     var nodes = document.getElementsByTagName("a"), i = nodes.length;
  3.     var regExp = new RegExp("//" + location.host + "($|/)");
  4.     while(i--){
  5.         var href = nodes[i].href;
  6.         var isLocal = (href.substring(0,4) === "http") ? regExp.test(href) : true;
  7.         if (!isLocal) nodes[i].href = "data:application/internet-shortcut,[INTERNETSHORTCUT]%0D%0AURL="+nodes[i].href;
  8.     }
  9. }
RAW Paste Data