v148 · url · security · interop · shipped
IDNA ContextJ rules
Chrome 148 enforces IDNA2008's ContextJ rules when parsing URLs, disallowing the Zero Width Non-Joiner (U+200C) and Zero Width Joiner (U+200D) characters in most positions in internationalized domain names. This closes a homograph-attack vector and aligns Chrome with Firefox and Safari. Ships in Chrome 148 on all platforms.
at a glance
| Shipped in | Chrome 148 (desktop, Android, WebView) |
|---|---|
| Status | Enabled by default |
| Type | Security / interoperability fix — no new API |
| Spec | WHATWG URL Standard — IDNA (Unicode TR46 §Processing) |
| ChromeStatus | 6295810820145152 — IDNA ContextJ rules (API record) |
background: IDNA and ContextJ
Internationalized Domain Names in Applications (IDNA) defines how non-ASCII characters in domain names are encoded and validated. The URL Standard invokes IDNA processing with the CheckJoiners flag, which enables the ContextJ rules from IDNA2008/Unicode Technical Standard 46.
ContextJ rules restrict where the invisible formatting characters ZWNJ (U+200C, Zero Width Non-Joiner) and ZWJ (U+200D, Zero Width Joiner) may appear in domain labels. These characters are legitimate in scripts like Arabic and Indic where they affect shaping, but only in specific phonetically valid positions. Allowing them anywhere creates a security risk: a malicious domain can contain ZWJ/ZWNJ to produce a label that looks identical to a legitimate domain in a browser address bar.
Source: Unicode Technical Standard 46 — Unicode IDNA Compatibility Processing; RFC 5892 Appendix A.1; Appendix A.2.what changed in Chrome 148
Before Chrome 148, Chrome did not enforce ContextJ rules when parsing URLs. A URL containing ZWJ or ZWNJ in a domain label would be parsed and resolved without error — even in positions the IDNA specification disallows.
Chrome 148 passes the UIDNA_CHECK_CONTEXTJ option to ICU when processing domain labels. URLs that violate ContextJ rules are now treated as invalid:
- Navigation to such a URL produces a network error.
new URL('http://example.com/')throws aTypeError.- The change fixes over 200 previously-failing WPT subtests for IDNA URL parsing.
Formal rules
The URL Standard’s domain parser ToASCII calls UTS #46 with CheckJoiners always on, whatever beStrict is (quoted 2026-11-15):
domain parser ToASCII(domain, beStrict) =
Unicode ToASCII(domain_name = domain,
CheckHyphens = beStrict,
CheckBidi = true,
CheckJoiners = true,
UseSTD3ASCIIRules = beStrict,
Transitional_Processing = false,
VerifyDnsLength = beStrict,
IgnoreInvalidPunycode = false)
With CheckJoiners set, UTS #46 validity criteria require each label to satisfy the ContextJ rules of IDNA2008. Those rules, verbatim from RFC 5892 Appendix A.1 and Appendix A.2:
U+200C ZERO WIDTH NON-JOINER — Rule Set:
False;
If Canonical_Combining_Class(Before(cp)) .eq. Virama Then True;
If RegExpMatch((Joining_Type:{L,D})(Joining_Type:T)*\u200C
(Joining_Type:T)*(Joining_Type:{R,D})) Then True;
U+200D ZERO WIDTH JOINER — Rule Set:
False;
If Canonical_Combining_Class(Before(cp)) .eq. Virama Then True;
In words: a ZWJ is valid only right after a virama. A ZWNJ is valid right after a virama, or between a left- or dual-joining letter and a right- or dual-joining letter (transparent marks may sit in between), as in Persian. Anywhere else, for example between two Latin letters, the label fails and so does the whole host. In the lax URL parser a failure only becomes a URL failure for non-ASCII input. An all-ASCII host is lowercased and accepted even when Unicode ToASCII reports an error.
Source: blink-dev Intent to Ship (msg14721) (Google Groups thread); WHATWG URL §idna; URL §domain parser ToASCII; UTS #46 §4.1 Validity Criteria; RFC 5892 A.1, A.2; WPT IdnaTestV2.examples and impact on web content
Legitimate content is not affected. ZWJ and ZWNJ in domain names are only valid in narrow phonological contexts within specific scripts; no correct internationalized domain name uses these characters in the positions that are now rejected.
Sites that constructed URLs programmatically with embedded invisible characters (intentionally or through encoding bugs) will receive a failure instead of a silently accepted URL. This is the intended behaviour.
// Before Chrome 148: silently accepted
// Chrome 148+: throws TypeError — ZWNJ disallowed in this position
try {
const url = new URL('http://xn--nexample.com/');
} catch (e) {
console.error('Invalid URL:', e.message);
}
The same rule with escapes, so the joiners are visible. Results are from headless Chromium 153 (2026-11-15). The behaviour is expected from Chrome 148 on but was not run on a 148 build:
const hosts = {
zwnjBetweenLatin: 'a\u200Cb.example', // no virama, Latin letters don't join
zwjBetweenLatin: 'a\u200Db.example',
zwnjAfterVirama: '\u0915\u094D\u200C\u0937.example', // Devanagari KA + virama + ZWNJ + SSA
zwjAfterVirama: '\u0915\u094D\u200D\u0937.example',
persianZwnj: '\u0645\u06CC\u200C\u062E\u0648\u0627\u0647\u0645.example', // Persian word: ZWNJ between joining letters
};
for (const [name, host] of Object.entries(hosts)) {
console.log(name, URL.canParse(`https://${host}/`));
}
// zwnjBetweenLatin false
// zwjBetweenLatin false
// zwnjAfterVirama true (hostname xn--11b2ezcs70k.example)
// zwjAfterVirama true (hostname xn--11b2ezcw70k.example)
// persianZwnj true (hostname xn--mgbn2ecje63gr19l.example)
Live example
The Chrome Platform Showcase IDNA ContextJ page collects five interactive demos. The embed below is its ContextJ Demo. It runs the parser of the browser you are viewing it in, so a browser before Chrome 148 gives the old results.
browser support
BCD has no entry for this change. BCD api/URL.json (fetched 2026-11-15) records the URL() constructor (Chrome 19, Edge 12, Firefox 26, Safari 14.1), but has no sub-feature for IDNA, joiners or ContextJ. The table below is therefore interim, taken from the ChromeStatus record:
| Browser | ContextJ enforced in URL parsing | Notes |
|---|---|---|
| Chrome | 148 (desktop, Android, WebView) | Enabled by default. ChromeStatus records the Finch feature name UseIDNAContextJRules and no chrome://flags entry. |
| Edge | Unknown | No separate record. Edge uses Chromium’s URL parser, so it is expected to follow Chrome 148, but this was not verified. |
| Firefox | Shipped (version unknown) | ChromeStatus: “Shipped for a long time, exact version not found”. |
| Safari | Shipped (version unknown) | ChromeStatus: “Shipped for a long time, exact version not found”. |
For per-engine results on the test cases, see WPT url/IdnaTestV2.window.html. webstatus.dev has no web-features entry for this change, so there is no Baseline status.