-
Notifications
You must be signed in to change notification settings - Fork 106
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
Homograph attack (Security) #84
Comments
Hi :), In my bug hunter's experience, I got always fixed this type of issue (also other researchers... https://hackerone.com/hacktivity?order_direction=DESC&order_field=popular&filter=type%3Apublic&querystring=homograph sees mostly this issue fixed), so I suggest you to do the same, as it's a bad behavior that can be avoided without lots of changes :) Best, Mik |
I believe the manual workaround is
|
Decode URLs using punycode when rendering, so when http://ebаy.com is sent we render http://xn--eby-7cd.com/ instead. Ref: tasti/react-linkify#84
Decode URLs using punycode when rendering, so when http://ebаy.com is sent we render http://xn--eby-7cd.com/ instead. Ref: tasti/react-linkify#84
Issue
This lib, even the Github viewer itself, is vulnerable to a homograph attack - meaning that we can leverage a seemingly innocent link e.g.
http://ebаy.com
to redirect users to actuallyhttp://xn--eby-7cd.com
Imagine if a user posts a link like this into a forum and has other susceptible users click on it.
Homograph normalized: http://ebаy.com (hover over the URL to see the browser decode the URL)
Actual equivalent IDN (punycode): http://xn--eby-7cd.com
Further reading
https://en.wikipedia.org/wiki/IDN_homograph_attack
Potential remediation
https://en.wikipedia.org/wiki/IDN_homograph_attack#Defending_against_the_attack
We can leverage punycode (https://en.wikipedia.org/wiki/Punycode) to display the URL instead of the normalized URL. This could be a configurable option for the lib so the user of the lib can choose their risk profile. But I would recommend setting the use of punycode to true by default so we can avoid the security issue as described.
https://www.npmjs.com/package/punycode is a popular lib for JS.
Originally reported by @Mik317 to our security program
The text was updated successfully, but these errors were encountered: