Commit 7bff9ff0 authored by Mustafa Emre Acer's avatar Mustafa Emre Acer Committed by Commit Bot

[IDN Spoofs] Check for digit lookalikes when the input label is same script

We currently treat an IDN label as safe if all its characters are
same script. However, the characters might still be digit lookalikes.
This CL adds an additional digit lookalike checks for these cases.

This change doesn't impact any real world domains with more than 10
monthly users.

Bug: 1100485
Change-Id: Ief3e136dbfd58ccc247fb94b2fab874189a095f0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2274617
Commit-Queue: Mustafa Emre Acer <meacer@chromium.org>
Reviewed-by: default avatarJoe DeBlasio <jdeblasio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#783813}
parent e6a4f66e
...@@ -425,6 +425,10 @@ IDNSpoofChecker::Result IDNSpoofChecker::SafeToDisplayAsUnicode( ...@@ -425,6 +425,10 @@ IDNSpoofChecker::Result IDNSpoofChecker::SafeToDisplayAsUnicode(
return Result::kWholeScriptConfusable; return Result::kWholeScriptConfusable;
} }
} }
// Disallow domains that contain only numbers and number-spoofs.
if (IsDigitLookalike(label_string))
return Result::kDigitLookalikes;
return Result::kSafe; return Result::kSafe;
} }
......
...@@ -153,6 +153,8 @@ const IDNTestCase kIdnCases[] = { ...@@ -153,6 +153,8 @@ const IDNTestCase kIdnCases[] = {
{"xn--0-6ee.com", L"੨0.com", kUnsafe}, {"xn--0-6ee.com", L"੨0.com", kUnsafe},
// Block fully numeric lookalikes (৪੨.com using U+09EA and U+0A68). // Block fully numeric lookalikes (৪੨.com using U+09EA and U+0A68).
{"xn--47b6w.com", L"৪੨.com", kUnsafe}, {"xn--47b6w.com", L"৪੨.com", kUnsafe},
// Block single script digit lookalikes (using three U+0A68 characters).
{"xn--qccaa.com", L"੨੨੨.com", kUnsafe},
// URL test with mostly numbers and one confusable character // URL test with mostly numbers and one confusable character
// Georgian 'd' 4000.com // Georgian 'd' 4000.com
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment