Skip to content
XSS Write-up Intermediate

Bypassing IE's XSS Filter with HZ-GB-2312 escape sequence

The Internet Explorer XSS filter can be bypassed using HZ-GB-2312 escape sequences when the page's Content-Type header lacks a charset. An attacker could inject script that executes in the victim's browser.

Unknown Follow

Published on mksben.l0.cm

The original lives on mksben.l0.cm

We do not hold its text, 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 IE XSS filter fails to properly handle HZ-GB-2312 escape sequences when the page's charset is not specified in the Content-Type header, allowing an attacker to break out of a string or inject HTML.

Impact

An attacker could execute arbitrary JavaScript in the context of the vulnerable page, potentially leading to data theft or other actions on behalf of the victim, but only if the page's Content-Type header lacks a charset and the victim uses Internet Explorer.

What the attacker needed

Victim uses Internet Explorer; target page lacks charset in Content-Type; attacker can inject input into the page

How it was found

  1. Ensure the target page's Content-Type header does not specify a charset.
  2. Inject a payload containing the HZ-GB-2312 escape sequence ~[0x0A] followed by an event handler such as onmouseover=alert(1).
  3. For a no-interaction version, use onfocus=alert(1) with id=a and tabindex=0, and append #a to the URL.
  4. Alternatively, use the escape sequence ~{ to call same-origin methods like opener.button.click from a string literal.

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.

Internet Explorer has a built-in filter that tries to block cross-site scripting (XSS) attacks, where an attacker injects malicious code into a web page. This report shows that by using special characters from an old Chinese encoding called HZ-GB-2312, the filter can be tricked into allowing the attack. The bypass only works if the web page does not declare its character encoding in the HTTP header.

What is XSS?

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

More by Unknown

View all

32 more disclosed reports, best first.

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.