Authentication errors in server side validaton of E-MAIL
The email-adding endpoint accepted addresses that the client-side form rejected, because validation only happened in the browser. An attacker could save malformed addresses containing HTML markup and addresses of arbitrary length.
Originally disclosed on HackerOne
- Disclosed after 4 days
To be honest, I'm not sure if there is any real security implications of this bug, but it's something which should be fixed at some point (since it'll be pretty easy). I'm going to describe the issue with reproducible steps:
- Navigate to Gratipay Settings Page. https://gratipay.com/~username/settings/
- Try adding an invalid e-mail address. ex:
[email protected]'. - You won't be able to, as it says "please add an e-mail address. means you're only allowed to add a valid e-mail address.
Now this can be bypassed by intercepting request. Let me show you how.
- Add a valid email address in e-mail field. ex:[email protected]
- Run any Request Repeater (ex: BURP Repeater, Live HTTP Header, Temper Data)
- Click Add E-Mail Address and intercept the request.
- Go to your repeater and you'll find there this form contents,
POST https://gratipay.com/~lolzsec007/emails/modify.json Post Content:
action=add-email&address=mymail%40gmail.com
- Change email address from
mymail%40gmail.comtomymail%40gmail.com"><h1> - Reply/Repeat your request.
- The Invalid Email address will get saved.
So that means, there is no server side validation for adding e-mail addresses. Now in this point, i would like to talked about another issue that i noticed because of this process, I discovered there is simply character limit for email addresses, as there is no server side validation implemented, an attacker can add an email address with as much characters he wants. but as per RFC, an email address that has more than 255 characters, shouldn't be allowed.
Possible Fix:
- Implementation of server side validation for email address should resolve both issues.
Looking forward. Thanks
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 application relied only on client-side validation and never re-checked the email address on the server before saving it.
Impact
Malformed and over-long email addresses could be stored; the author is unsure of any real security impact.
What the attacker needed
A free account; ability to intercept HTTP requests
The fix
The report recommends adding server-side validation of email addresses, which should address both the malformed-address and length issues.
How it was found
- Open the account settings page.
- Try to add an invalid email address and note the browser refuses it.
- Enter a valid address and submit while intercepting the request.
- In the intercepted request, replace the address with a malformed one containing markup.
- Replay the request and observe the invalid address is saved.
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.
A website can check input in two places: in your browser (client side) and on its own server (server side). Here the browser refused a bad email address, but the server accepted whatever was sent to it directly, so anyone using a tool to edit the request could store junk or markup in the email field.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.