PunyCode Domain Detection

PunyCode Domain Detection

Is that really paypal.com? A Firefox add-on that stops look-alike web addresses before they open.

Version 1.0.0 · Manifest V3 · Firefox 140+ and Firefox for Android 142+ · MIT · no network requests, no data collected

Add to FirefoxSource code (git)What's new in 1.0
The warning page for a fake paypal.com

The trick

Domain names can contain letters from any alphabet. Some of them look exactly like Latin letters, so phishing sites register names that are impossible to tell apart in the address bar:

You seeReal addressThe trick
pаypal.comxn--pypal-4ve.comCyrillic “а” (U+0430) instead of Latin “a”
аррӏе.comxn--80ak6aa92e.comwritten entirely in Cyrillic letters
mozılla.comxn--mozlla-r9a.comTurkish dotless “ı”
paypa1.compaypa1.comthe digit one instead of “l”

Firefox shows the real xn-- (Punycode) form only in some of these cases. This add-on checks every address you open.

What it does

A page is stopped when its name:

The look-alike characters come from the Unicode security data (UTS #39, 1,797 characters).

Toolbar panel

Panel with the verdict for a fake apple.com
Checking a link in the panel
Options: protection mode, trusted sites, sites to protect

Firefox for Android

On a phone the address bar has little room to show the real address, so the add-on is even more useful there. The warning page and the panel are designed for touch screens. Open the panel from ⋮ → Extensions → PunyCode Domain Detection.

Warning page on a phonePanel on a phone

Permissions

PermissionWhy
Access your data for all websitesCheck the address of each page you open (the page content is never read).
webRequest, webRequestBlockingReplace a look-alike address with the warning page before the request is sent. Only the pages you open in a tab are checked, not images or frames.
storageYour settings, trusted sites and sites to protect.

Nothing leaves your device: see Privacy.

Source code and tests

Plain, unminified code with no third-party libraries. 75 unit checks of the analysis and 53 end-to-end checks in a real Firefox. Get it from the git repository or the downloads.