How I was able to change victim’s password using IDN Homograph Attack
The password reset form failed to properly validate the email address, so an attacker could submit a lookalike internationalised domain name that the mail system normalised to the victim's real address. The reset link was then delivered to a domain the attacker controlled, allowing the attacker to change the victim's password.
Published on medium.com
{{media:0}}
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
This is a write-up of a vulnerability found in a Bugcrowd private program. The researcher refers to the target only as target.com. The affected feature is the password reset flow, specifically the endpoint that accepts an email address:
https://target.com/forgot-password?email=
The report says the email value is not properly validated, and that this was used to take over an account by changing its password using an IDN homograph attack.
An IDN homograph attack deceives users about which remote system they are talking to by exploiting the fact that many different characters look alike. For example, a user of example.com may be lured to a link where the Latin character a is replaced with the Cyrillic character а.
Setup
- A Bugcrowd private program, referred to as
target.com. - A Burp Collaborator client, used so the attack can be tested without buying a domain.
- A domain is only needed for the real attack: to perform it, the attacker has to buy
xn--gmil-6na.com. - The researcher credits a
#bugbountytipspost on Twitter as the starting point: https://twitter.com/musiclouderlml/status/1276987908340232193?s=19
Finding it
The researcher saw the Twitter tip and decided to try the technique on the Bugcrowd private program. The observation is that the password reset endpoint fails to properly validate the email value, and that this can be used to take over a user's account by changing their password.
The mechanism: characters such as a and á look alike. The attacker requests a password reset for [redacted], where the a carries an acute accent and looks exactly like a plain a. If the victim's account is [redacted], the target's mail system sends the victim's password reset link to the attacker's mail at [redacted].
Exploitation
Step 1: Generate a Collaborator payload
Open the Burp Collaborator client and generate a Collaborator payload. The report says the Collaborator client lets you test without buying a domain.
Step 2: Create an account with a crafted address
Go to the sign-up page of target.com and create a new account with the email:
[redacted]
Step 3: Verify the email if confirmation is required
If target.com has email confirmation, the confirmation link arrives in the Burp Collaborator client. Verify the email.
Step 4: Request a reset for the homograph address
Go to the password reset page of target.com and enter the email as:
[redacted]
Step 5: Receive the reset link
If target.com is vulnerable, it sends the password reset link to:
[redacted]
and the reset link arrives in the Burp Collaborator client. Check the received email details in the client, which show:
To- [redacted]

The report gives the received email details as To- [redacted].
Step 6: Change the password
With the reset link in hand, change the password and access the victim's account.

Root cause
The password reset endpoint does not properly validate the email parameter. The report says the email value is not properly validated, and that the mail system sends the victim's reset link to [redacted]. The reset link for the victim's account is then delivered to the attacker's mail host.
The report does not describe the server-side code or the specific validation that is missing, so the exact mechanism is not stated. The report says the target's mail system sends the victim's reset link to [redacted].
Impact
The report says the email value was used to take over the user's account by changing his password using an IDN homograph attack. In the real attack this requires buying the homograph domain xn--gmil-6na.com. The report demonstrates the attack against a single account and does not describe any additional conditions, such as whether the victim has to interact with anything.
Fix
The report does not say what was changed.
Variants to test
- Try other homograph characters in the local part and domain of the reset address, for example Cyrillic
аin place of Latina, and see whether the reset link is delivered to the punycode equivalent. - Try the same technique on sign-up and email-change flows, where a confirmation link is sent to the address, and check whether the confirmation arrives at the punycode domain.
- Try addresses with a Collaborator payload appended, as in the report, to test without buying a domain; a positive result is the reset or confirmation email arriving in the Collaborator client with a
Toheader showing the punycode form. - Try the technique on other endpoints that accept an email address and send a link, such as invitation or notification features, and check whether the link is delivered to the attacker-controlled domain.
What happened, in plain words
A security researcher found a way to take over someone else's account on a website by abusing the "forgot my password" feature. The trick relies on two letters that look identical to the human eye but are actually different characters: the ordinary Latin a and the accented á. When you type an email address containing the accented version, the website's mail system sends the reset link to a different domain name, one that the attacker can own. The password reset link that was meant for the victim ends up in the attacker's mailbox instead, and from there the attacker sets a new password and walks into the account.
The researcher tested this on a private bug bounty program on Bugcrowd, which he refers to only as target.com. This is his first write-up, and he credits a #bugbountytips post on Twitter as the idea that started it: https://twitter.com/musiclouderlml/status/1276987908340232193?s=19

The idea behind the attack
Before the steps, you need one concept: the IDN homograph attack. The name sounds intimidating, but the idea is simple.
Computers identify websites and mail servers by domain names, the part after the @ in an email address or after https:// in a web address, such as gmail.com. Domain names were originally limited to a small set of Latin letters, digits and hyphens. Later, a system called internationalised domain names (IDN) was added so that people could register names in their own scripts, for example Cyrillic or Chinese characters. To keep the old system working, such a name is stored in a converted form called punycode, which starts with xn-- and uses only plain ASCII characters.
The problem is that many characters from different alphabets look the same. The Latin a and the Cyrillic а are different characters, but on screen they are indistinguishable. So are a and á. An attacker can register a domain that looks exactly like a well-known one but is actually a different string underneath. A user who glances at the address sees the familiar name; the computer sees something else entirely.
A useful comparison: it is like a shop sign that reads "Nike" but where the i is actually a slightly different letter from another alphabet. From across the street it looks like the real shop. Only a close inspection of the exact characters reveals the difference.
In this report the researcher uses the accented á in place of the plain a in gmail. The victim's real address is [redacted]. The lookalike address is [redacted], which to a human reads the same. Underneath, the domain part gmáil.com is not gmail.com at all; it converts to the punycode domain xn--gmil-6na.com, which the attacker can buy.
The vulnerable feature
The affected feature is the password reset flow. On almost every website with accounts, there is a "forgot password" link. You type your email address, the site looks up the account that belongs to it, and it emails you a password reset link: a special web address containing a long, hard-to-guess code. Opening that link proves you control the mailbox, and lets you set a new password.
The endpoint involved is the address the reset form submits to:
https://target.com/forgot-password?email=
An endpoint is simply a specific address on a server that performs one job. Here, forgot-password is the job, and email= is a parameter, a named slot where the form puts the value the user typed. Everything after the = is the value. When you press the button on the reset form, your browser sends a request to this address with your email filled in after email=.
The bug is that the server does not properly validate the value. Because of that, an attacker can make the reset link for a victim's account go to a domain the attacker controls, using the homograph trick described above.
Setting up
The researcher needed three things:
- A target: a private program on Bugcrowd, referred to as
target.com. A private program is a bug bounty programme that is not open to the public; only invited researchers can test it. A bug bounty programme is an arrangement where a company pays researchers for reporting security flaws responsibly instead of exploiting them. - A way to receive email at a domain he did not own. For that he used the Burp Collaborator client. Burp is a well-known tool for inspecting and modifying web traffic. Collaborator is a companion feature that gives you a temporary, unique hostname and tells you whenever something contacts it, including incoming email. Think of it as a temporary mailbox with a made-up address that you can watch from your own computer. This lets you test the attack without spending money on a domain.
- For the real attack, a domain. The report says that to perform the attack for real, the attacker has to buy
xn--gmil-6na.com. That is the punycode form of the lookalikegmáil.com.
Finding it
The researcher saw the Twitter tip, decided to try the technique, and started hunting on the Bugcrowd private program. His observation was that the password reset endpoint fails to properly validate the email value, and that this can be used to take over a user's account by changing their password.
The mechanism, restated plainly: characters such as a and á look alike. The attacker asks for a password reset for [redacted], where the a carries an acute accent and looks exactly like a plain a. If the victim's account is [redacted], the target's mail system sends the victim's password reset link to the attacker's mail at [redacted].
Why does that happen? The report says the target's mail system sends the victim's reset link to [redacted].
Exploitation, step by step
Step 1: Generate a Collaborator payload
Open the Burp Collaborator client and generate a Collaborator payload. A payload here just means the unique hostname the tool hands you, something like a random string followed by a domain the tool controls. This gives you a hostname you control for receiving mail, so no domain purchase is needed for testing. You will paste this hostname into the email addresses in the next steps.
Step 2: Create an account with a crafted address
Go to the sign-up page of target.com and create a new account with the email:
[redacted]
Read this address carefully. The part before the @ is abc, and the part after it is gmail.com.burpcollaboratorpayloadhere. In other words, the domain is not gmail.com; it is gmail.com followed by a dot and then the Collaborator hostname. The report says the confirmation and reset emails arrive in the Collaborator client. The [redacted] at the front is there to make the address look plausible and to mirror the victim's address in the later steps.
Step 3: Verify the email if confirmation is required
If target.com has email confirmation, the confirmation link arrives in the Burp Collaborator client. Verify the email. Many sites send a link to prove you really own the mailbox before they let you use the account. Since the mailbox here is the Collaborator client, the link shows up there, and clicking it completes the sign-up.
Step 4: Request a reset for the homograph address
Go to the password reset page of target.com and enter the email as:
[redacted]
Compare this with the address from step 2. The only difference is the a in gmail: here it is the accented á. To a human reading the screen, the two addresses look the same. To the server, the domain part is now gmáil.com.burpcollaboratorpayloadhere, which is a different domain from the one in step 2.
This is the heart of the test. The researcher is asking the site to reset the password for the account whose address looks like the victim's, and to send the reset link to a mailbox he controls.
Step 5: Receive the reset link
If target.com is vulnerable, it sends the password reset link to:
[redacted]
and the reset link arrives in the Burp Collaborator client. Notice what changed: the accented gmáil has been converted to its punycode form xn--gmil-6na. That is the standard way to represent a non-ASCII domain using only plain characters, and it is the domain the attacker would own in a real attack.
Check the received email details in the client, which show:
To- [redacted]
The To line is the header of the email that says who the message was addressed to. Seeing the punycode form there confirms that the site accepted the lookalike address and delivered the message to the domain it represents, not to the victim's real mailbox.

The report gives the received email details as To- [redacted].
Step 6: Change the password
With the reset link in hand, change the password and access the victim's account. The reset link is the proof that you control the mailbox; opening it lets you set a new password for the account it belongs to. Because the site sent that link to the attacker's mailbox, the attacker can now set a password and log in as the victim.

Why it works
The password reset endpoint does not properly validate the email parameter. The report says the email value is not properly validated, and that the mail system sends the victim's reset link to [redacted]. The reset link for the victim's account is then delivered to the attacker's mail host.
The report does not describe the server-side code or the specific validation that is missing, so the exact mechanism is not stated.
A comparison may help. Imagine a receptionist who is supposed to check that a courier is delivering to the right office. If the courier writes the office name with a lookalike letter, the receptionist reads it as the right office and hands over the parcel. The receptionist did not check the exact spelling, only the general shape. Here the server is the receptionist and the reset link is the parcel.
What an attacker could do with it
The report says the email value was used to take over the user's account by changing his password using an IDN homograph attack. In the real attack this requires buying the homograph domain xn--gmil-6na.com. The report demonstrates the attack against a single account and does not describe any additional conditions, such as whether the victim has to interact with anything.
How it could be fixed
The report does not say what was changed. In plain terms: the server should check the exact characters of the address, not just its general appearance, and refuse anything that does not match a real account's address exactly.
Other places to try the same idea
- Try other homograph characters in the local part and domain of the reset address, for example Cyrillic
аin place of Latina, and see whether the reset link is delivered to the punycode equivalent. - Try the same technique on sign-up and email-change flows, where a confirmation link is sent to the address, and check whether the confirmation arrives at the punycode domain.
- Try addresses with a Collaborator payload appended, as in the report, to test without buying a domain; a positive result is the reset or confirmation email arriving in the Collaborator client with a
Toheader showing the punycode form. - Try the technique on other endpoints that accept an email address and send a link, such as invitation or notification features, and check whether the link is delivered to the attacker-controlled domain.
Glossary
- Bug bounty programme: an arrangement where a company pays security researchers for reporting flaws responsibly instead of exploiting them.
- Private program: a bug bounty programme open only to invited researchers.
- Bugcrowd: a platform that hosts bug bounty programmes.
- Endpoint: a specific address on a server that performs one job, such as handling a password reset.
- Parameter: a named slot in a request where a value is placed, such as
email=in a web address. - Validation: checking that a value is well formed and safe before using it.
- Password reset flow: the feature that emails a special link so a user can set a new password.
- Password reset link: a web address containing a hard-to-guess code that proves the holder controls the mailbox.
- Domain name: the part of a web or email address after
https://or@, such asgmail.com. - IDN (internationalised domain name): a domain name that can contain characters from non-Latin scripts.
- Punycode: the plain-ASCII form of an IDN, starting with
xn--. - IDN homograph attack: deceiving users by registering a domain that looks like a well-known one but uses lookalike characters from another script.
- Homograph: a character that looks the same as another but is a different character.
- Burp: a tool for inspecting and modifying web traffic.
- Burp Collaborator client: a Burp feature that gives you a temporary hostname and reports back whenever something contacts it, including incoming email.
- Payload: here, the unique hostname the Collaborator tool hands you.
- Header: a line at the top of an email or web request that carries metadata, such as who the message is addressed to.
Toheader: the email header that says which address the message was sent to.- Account takeover: gaining control of someone else's account, for example by changing their password.