Skip to content
XSS Write-up Intermediate

IE9 Self-XSS Blackbox Protection bypass

IE9's protection against pasting javascript: URLs into the address bar can be bypassed by prefixing the protocol with a malformed file: scheme and control characters, allowing script execution. An attacker could trick a user into pasting such a string and pressing Enter, leading to cookie theft or file system access.

soroush.me

Published on soroush.me

There is a defense-in-depth technique in IE9 that protects users against self XSS attacks which are growing very fast among social networking users (http://nakedsecurity.sophos.com/2010/02/02/anatomy-free-starbucks-gift-card-scam/ & https://www.facebook.com/video/video.php?v=956977232793).

The author, on soroush.me

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the browser's paste-protection only checked for a plain 'javascript:' prefix and did not account for malformed file: schemes with control characters that still allowed script execution.

Impact

An attacker could execute script in the context of a visited site, potentially stealing cookies, and could also browse the file system on kiosk devices with address bar blacklists.

What the attacker needed

Victim uses IE9; victim pastes crafted string into address bar; attacker can control an iframe on target site

The fix

The text does not state a fix; Microsoft reportedly classified it as a low issue.

How it was found

  1. Add a letter before or after the file protocol, or both.
  2. Add space or control characters after the colon.
  3. Prepend the result to 'javascript:' followed by code.
  4. Open IE9 and navigate to a website.
  5. Paste the final string into the address bar and press Enter.
  6. Observe that the script executes (e.g., cookies are displayed).

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Self-XSS is when a user is tricked into pasting malicious code into their own browser. IE9 tried to block this by removing 'javascript:' from pasted text, but the check could be fooled by adding extra characters before it. This let an attacker run script in the user's browser if they pasted a specially crafted string.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.