-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn users whenever an ENS name contains a homoglyph vulnerability #9129
Comments
I believe our reverse-resolved ENS names are always displayed as punycode, so they aren't susceptible to this problem. |
🙏
Current Metamask lookup with Non-ASCII name Show normalized Warning should focus on all non-ASCII names, check against possible impersonator/scam scenarios and specific homoglyphs without triggering false alarm on all international/emoji names. This is IDNA mess long before ETH/ENS mess.
Etherscan is warning
Etherscan lookup for
IDK if etherscan is using EIP-137 compatible normalization process. OR it's ok for metamask to follow same rules.. UTS46.js Known issues
|
A problem with enforcing ascii rules is it doesn't represent the scope of ENS, which supports many character sets, including emoji. If we converted all to punycode, we would be effectively limiting the whole of ENS to ASCII-character languages. |
This line from
I'm bit confused IF ENS spec was asking for Example from So I think it's ok to show full IDNA mess with warning.
|
Unicode.org's has a working group that maintains a list of 'confusable' unicode characters along with the character it might be confused with, called confusables.txt I put together a library that translates the confusables.txt file into a lookup table and then used it to build what I think is a pretty nice warning system. It is able to detect 'vitalik.eth' It can also detect 'faceboоk.eth' It might even be a little too strict because it warns on 'math.eth' being so similar to 'rnath.eth' Best of all it doesn't mangle emoji! You can see from the tests that it even warns on similar Japanese. The downside is that 100KB of json (30KB gzipped) gets added to the ui bundle. |
I should add that one improvement could be to convert the 'confusable' name into it's non confusable version then resolve and display both names in the list, highlighting the differences. Hopefully this helps! |
Design update recommendations:
|
What happens in the use case that an ENS name is created in another language (e.g., Greek, Hebrew, etc) that uses homoglyph characters? |
Removing the tooltip makes sense! That is the only place where the specific character that was confusing is explained though, which is something to consider maybe. |
@rachelcope @Gudahtt are you letting the user continue in the flow if a homoglyph is detected? |
Hi @cjeria, I would definitely recommend allowing users to continue the flow if a homoglyph is detected. Languages such as Greek, Hebrew, etc. might have a higher false positive rate than English, but all languages will have false positives. For example, the Hebrew character 'ן' will warn users that it is confusable with 'l', even if the entire ENS domain is in Hebrew. It would be possible to remove the warning for 'ן' if all other characters in the ENS domain are in the Hebrew script set; however, this would require building another index from another Unicode working group. @rachelcope I like the updated copy, but I think it is important to change 'unusual' to 'confusable' if we are sticking with this implementation.
The best English example I can find for why this is confusable and not unusual is the letter 'm', which is marked as confusable with 'rn' according to the unicode working group. If we want only unusual characters to be detected then we could remove the confusable entries that are in the same script set (e.g. m -> rn), but only if the entire ENS domain uses the same script set. |
@lastcanal Thanks for the feedback. A design pattern we're considering (on the mobile app side at least) is to throw a warning that the users can bypass by acknowledging the alert. I could see this being a nuisance for some languages that use confusable characters but the main intent is to help identify deceptive names. Would this be acceptable in your opinion? |
Hi @cjeria I think that would work great; I am in no way annoyed by popups that are trying to save me from some scam :). Would it be possible to gather metrics on how often the popup is displayed? Extra work could be done later to de-escalate the error if the confusable characters are in the same alphabet/script set. |
@lastcanal thanks for your copy suggestion. Here's a small update to the error message to make it more concise: "We have detected an confusable character (homoglyph) in the ENS name. Check the ENS name to avoid a potential scam." @cjeria Before we add a required acknowledgement (on extension), we need to establish a design pattern and process for determining what errors require additional acknowledgement. For now, I suggest just show the standard/existing error message |
@Gudahtt here's the updated design and copy. Here's the figma file |
Uses unicode.org's TR39 confusables.txt to display a warning when 'confusable' unicode points are detected. Currently only the `AddRecipient` component has been updated, but the new `Confusable` component could be used elsewhere The new `unicode-confusables` dependency adds close to 100KB to the bundle size, and around 30KB when gzipped. Adds 'tag' prop to the tooltop-v2 component Use $Red-500 for confusable ens warning Lint Tooltip component Update copy for confusing ENS domain warning.
* Add warning system for 'confusable' ENS names (#9129) Uses unicode.org's TR39 confusables.txt to display a warning when 'confusable' unicode points are detected. Currently only the `AddRecipient` component has been updated, but the new `Confusable` component could be used elsewhere The new `unicode-confusables` dependency adds close to 100KB to the bundle size, and around 30KB when gzipped. Adds 'tag' prop to the tooltop-v2 component Use $Red-500 for confusable ens warning Lint Tooltip component Update copy for confusing ENS domain warning. * Fix prop type Co-authored-by: Mark Stacey <markjstacey@gmail.com>
An ENS name is a UTF-8 compatible string of text. That means there are many characters that have the same appearance, or homo-glyph.
This can cause some concerns when using an ENS name:
I had mentioned this acceptance criteria in a previous issue, but a basic check with a vulnerable name and I cannot find any warning.
MyCrypto has a tool called ens-validation that can do the hard part of this already, we just need to design & display the appropriate warnings.
Acceptance criteria:
to
field should show a warning. Can verify withvitalik.eth
, which is not the same asvitalik.eth
.Possible copy for the warning:
The text was updated successfully, but these errors were encountered: