Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: components/url_formatter/idn_spoof_checker.cc

Issue 2894313002: Block Tifinagh + Latin mix (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/url_formatter/url_formatter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/url_formatter/idn_spoof_checker.cc
diff --git a/components/url_formatter/idn_spoof_checker.cc b/components/url_formatter/idn_spoof_checker.cc
index dbed171b9ea309fa7d9450f1c7fe07e597df6225..edcec7f89fcfa6d824c2fae0d2c4e5923bdff103 100644
--- a/components/url_formatter/idn_spoof_checker.cc
+++ b/components/url_formatter/idn_spoof_checker.cc
@@ -167,6 +167,7 @@ bool IDNSpoofChecker::SafeToDisplayAsUnicode(base::StringPiece16 label,
// Letter Co) to be next to Latin.
// - Disallow Latin 'o' and 'g' next to Armenian.
// - Disalow mixing of Latin and Canadian Syllabary.
+ // - Disalow mixing of Latin and Tifinagh.
Peter Kasting 2017/05/22 18:47:46 Are there other "Latin + <script>" combos we shoul
dangerous_pattern = new icu::RegexMatcher(
icu::UnicodeString(
R"([^\p{scx=kana}\p{scx=hira}\p{scx=hani}])"
@@ -181,7 +182,8 @@ bool IDNSpoofChecker::SafeToDisplayAsUnicode(base::StringPiece16 label,
R"([a-z][\u0585\u0581]+[a-z]|)"
R"(^[og]+[\p{scx=armn}]|[\p{scx=armn}][og]+$|)"
R"([\p{scx=armn}][og]+[\p{scx=armn}]|)"
- R"([\p{sc=cans}].*[a-z]|[a-z].*[\p{sc=cans}])",
+ R"([\p{sc=cans}].*[a-z]|[a-z].*[\p{sc=cans}]|)"
+ R"([\p{sc=tfng}].*[a-z]|[a-z].*[\p{sc=tfng}])",
Peter Kasting 2017/05/22 18:47:46 Nit: Feels like there's maybe a less redundant way
-1, US_INV),
0, status);
tls_index.Set(dangerous_pattern);
« no previous file with comments | « no previous file | components/url_formatter/url_formatter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698