Email verification links still valid after changing it 2x
Verification links were generated deterministically from the email address, so changing back to a previously used address produced the same link again.
- Disclosed after 17 hours
When creating a new account on IRCCloud.com the user is asked to confirm his email address. The email verification link is formatted in the following way: ircloud.com/verify-emai/{user_id}/{email_address}/{hash_value}.
If the user decides to change his email address before he confirmed it, a new confirmation mail is sent to his newly entered address. At this point the old verification link is not valid anymore. However, if the user again changes it's email address, and uses the same address as he originally used to create his account the same verification link is sent again as the original one. The hash value in the URL seems to be generated based on the entered email address. This tells me that the hash is not very strong. I would would have expected some randomness here as well, at least to make sure that a new hash is generated the second time the user changed his email address. This can for example be done by adding a random salt to the hash. Ofcourse you will need to store this random value also to be able to recalculate the hash during verification.
In short:
- User creates account and receives verification link: verify-email/1/[email protected]/12345
- User changes email address. A new confirmation mail is sent with the following verification link: verify-email/1/[email protected]/85264
- Now the first verification link is not valid anymore.
- User changes email address back to [email protected]. He now receives the exact same link as before: verify-email/1/[email protected]/12345.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the verification token was derived deterministically from the email address (for example a plain hash) instead of being random and stored per request.
Impact
A previously issued verification link could become valid again when the user returns to that address.
What the attacker needed
An account with an unverified email; access to an old verification link
The fix
The token should be generated with randomness (for example a random salt stored alongside the address) so each verification request produces a unique link.
How it was found
- Create an account and receive a verification link for the first address.
- Change the email address; a new link is sent and the old one stops working.
- Change the address back to the original one.
- Observe that the newly sent link is identical to the very first one.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
The secret part of the link was made from the email address, so the same address always gave the same link.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.