Skip to content
Misconfiguration Disclosed report Intermediate CVE-2021-43533

IDNA does not conform to RFC and is interpreted as a different hostname

Firefox's URL parser incorrectly interprets internationalised domain names (IDNA) that contain invalid characters after the 'xn--' prefix, converting them to a different hostname. An attacker could exploit this to bypass WAFs and malware scanning, or for phishing, by crafting a URL that appears to be one domain but is parsed as another.

kageshiron Follow

Originally disclosed on Mozilla

  • Fixed in 43 days
  • Paid in 54 days
  • Disclosed after 43 days
Text
Firefox 90.0.2 (Latest MacOS/Windows)

Firefox's URL parser cannot correctly parse IDNA(Internationalizing Domain Names in Applications). 
You can check the behavior with the following HTML and JavaScript.

[HTML Sample] <a href="http://xn--あああ.example.com">URL</a>
[JavaScript Sample] new URL("http://xn--あああ.example.com").href
("あ" is U+3042 character)

Actual behavior:
  "http://xn--bbb.example.com"

Expected behavior: 
   "xn--あああ" is an invalid label for a domain name. Only alphanumeric characters are allowed after "xn--". Browsers should treat it as an error.

<Security Risk>
- Bypassing WAF and malware scanning
- Phishing
- Inconsistencies with applications that expect to be RFC compliant

<Cause of the problem>
  The codepoint for "あ" is U+3042, and the codepoint for "B" is "U+0042.
  I think Firefox's URL parser ignore the upper bytes of the string following "xn--" and try to interpret it.

<Other URLs that can be interpreted incorrectly>
  http://👨‍🦰.tk
  (This is the domain name I got.)

  The codepoints sequence for the 👨‍🦰 emoji is U+1F468 U+200D U+1F9B0.

  Actual Parsed Result [Firefox]:
    http://xn--1ugz855p6kd.tk
  Expected Parsed Result [ Chrome, ICU (International Components for Unicode) ]:
    http://xn--qq8hq8f.tk/
    (Removed Zero Width Joiner(U+200D) )

<Note>
  Apple Safari has the same problem. I have already reported the issue to apple.

The original report as published on Mozilla's Bugzilla, by kageshiron. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

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

How it worked

Root cause

Likely, Firefox's URL parser ignores the upper bytes of the string following 'xn--' and tries to interpret it, rather than rejecting invalid characters.

Impact

This could allow bypassing WAF and malware scanning, enable phishing, and cause inconsistencies with applications that expect RFC compliance; Safari has the same problem.

What the attacker needed

Victim uses Firefox or Safari; attacker crafts a malicious URL

How it was found

  1. Open Firefox and navigate to a page where you can run JavaScript or create an HTML link.
  2. Create a link or use the URL constructor with a hostname like 'http://xn--あああ.example.com'.
  3. Observe that Firefox parses the hostname as 'http://xn--bbb.example.com' instead of treating it as an error.

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 report has not been written yet. The Original tab links to the source.

When you type a web address, your browser converts it into a standard format. For international domain names, it uses a system called IDNA. This report shows that Firefox mishandles some invalid IDNA labels, turning them into a different address than intended. That could let an attacker hide a malicious site behind a link that looks safe.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.