Homograph attack
Also known as: IDN homograph attack, homoglyph attack, script spoofing, lookalike domain, confusable domain
A homograph attack uses characters that look identical to others — Cyrillic а in place of Latin a — so that a different domain, username or identifier appears to be a trusted one. Browsers defend domain names by showing the xn-- form of names that look suspicious instead of the Unicode spelling.
Overview
Unicode contains many characters that render identically, or nearly so, in common fonts. Cyrillic а, е, о, р, с and х are indistinguishable from Latin a, e, o, p, c and x, and Greek ο from Latin o. Because they are different code points, a domain spelled with them is a different domain — one anyone can register — that looks exactly like the real one in an address bar, an email link or a chat message. Evgeniy Gabrilovich and Alex Gontmakher described the attack in Communications of the ACM in 2002.
The attack comes in two shapes, and the second is the one that defeats simple checks. A mixed-script spoof swaps in a single foreign letter, as in аpple.com with a Cyrillic а, which encodes to xn--pple-43d.com; it is detectable because one label mixes Latin and Cyrillic. A whole-script spoof builds the entire label from one script. In April 2017 Xudong Zheng registered xn--80ak6aa92e.com, spelled entirely in Cyrillic, and Chrome 57, Firefox 52 and Opera displayed it as apple.com. There was no mixing to detect. Chrome 58 closed that gap the same month.
The defences that hold are about display and exact matching, not blocking. Browsers apply policies that fall back to the xn-- form when a label mixes scripts suspiciously or is made entirely of lookalikes for Latin letters under a non-matching top-level domain. Unicode's UTS #39 supplies the data behind such checks: confusables.txt maps every character to a skeleton, two strings with the same skeleton are confusable, and the standard defines mixed-script and whole-script detection on top of it. Password managers are a strong practical defence because they fill credentials by exact domain, so on a lookalike they find nothing and fill nothing.
The same trick works anywhere text stands in for identity: usernames and display names, package names in a registry, email sender names, and identifiers in source code. Exact string comparison cannot catch it, and neither can Unicode normalization, because Cyrillic а and Latin a are different letters rather than different encodings of one. Any system that shows user-chosen names as identities should compare UTS #39 skeletons when a name is registered, and refuse a new name that collides with an existing one.
Common questions about Homograph attack
How can I tell whether a domain is a homograph?
Do browsers protect against homograph attacks?
What is the difference between mixed-script and whole-script confusables?
Is this only a problem for domain names?
Does Unicode normalization prevent homograph attacks?
Tools that work with Homograph attack
Related concepts
IDN
An IDN (Internationalized Domain Name) is a domain name containing characters outside ASCII, which is carried through DNS as an ASCII xn-- form produced by the IDNA processing defined in UTS #46.
Punycode
Punycode is the encoding defined by RFC 3492 that represents a Unicode string using only the letters, digits and hyphen that DNS allows, producing the xn-- labels that carry internationalised domain names.
Unicode normalization
Unicode normalization rewrites text into one standard sequence of code points, so strings that look identical — é stored as a single precomposed character, or as e followed by a combining accent — compare as equal. Unicode defines four normalization forms: NFC, NFD, NFKC and NFKD.