document.referrer causing SCRIPT5011 Error after manipulation

Issue #19925541 • Assigned to Veerabhadra r.

Details

Author
Dietmar M.
Created
Dec 13, 2018
Privacy
This issue is public.
Found in
  • Microsoft Edge
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

The below statement will render document.referrer inaccessible, with no recovery possible. This code is derived from actual code used by some ad measurement and verification vendor, which subsequently crashed a number of other scripts on the same page.

((tempIframe) => {
document.body.appendChild(tempIframe);
var origGetter = document.lookupGetter(“referrer”);
var tempGetter = tempIframe.contentDocument.lookupGetter(“referrer”);
document.defineGetter("referrer", tempGetter);
tempIframe.parentNode.removeChild(tempIframe);
document.defineGetter("referrer", origGetter);
})(document.createElement(“iframe”));

Attachments

Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “Veerabhadra r.”

  • Hi, Thanks for reporting your feedback. We tested it and we cannot confirm it as a Edge browser issue. Could you please provide more information such as any error logs, screenshots or related snippet code that will help us to investigate further and reproduce this issue. 

    Best Regards,
    The MS Edge Team

  • Hi Veerabhadra,

    thanks for looking into this issue. To reproduce the issue please take these steps:

    1. copy the sample command (also available here)
    ((tempIframe) => {
      document.body.appendChild(tempIframe);
      var origGetter = document.__lookupGetter__("referrer");
      var tempGetter = tempIframe.contentDocument.__lookupGetter__("referrer");
      document.__defineGetter__("referrer", tempGetter);
      tempIframe.parentNode.removeChild(tempIframe);
      document.__defineGetter__("referrer", origGetter);
    })(document.createElement("iframe"));
    
    1. paste it into the developer tools’ console in Edge and execute it
    2. try to access document.referrer, e.g. by typing that into the console: you will get the error as mentioned (Screenshot).

    Reproduced on many different machines. Please let me know if any further questions!

    Best,
    Dietmar

  • Provided the wrong screenshot in my previous comment. This one’s better:
    SCRIPT5011 Error when accessing document.referrer

You need to sign in to your Microsoft account to add a comment.

Sign in