prevent null bytes in email field
The email address field on the user's email settings page accepted invalid characters such as null bytes and other special characters, and the server-side validation did not reject them. An attacker could add malformed email addresses to an account, which the text says is not expected behaviour.
- Triaged in under an hour
- Disclosed after 13 hours
Hi, Zawad here.
Description I recently visited gratipay.com and logged in. I found that invalid characters ( eg. null bytes ) were accepted in email field, which is obviously not an expected behavior.
Steps to Reproduce
- Go to https://gratipay.com/~username/emails/
- Enter
[email protected]\0or[email protected]%00or[email protected]$ - Now Inspect Element the field and change field type to
textfromemail - Click on Add email address.
You'll see an error message Looks like you've found a bug! Sorry for the inconvenience, we'll get it fixed ASAP! Now reload the page and you'll see the email listed.
It means server side validation of email is not okay. Validation should be improved.
For your reference, #3227 and #3991 are same kind of bug which were resolved.
Zawad
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 server-side email validation was too weak or missing, so malformed values were stored even though the browser's email field would normally reject them.
Impact
An attacker could store malformed email addresses on an account, which may cause errors or unexpected behaviour, though the text does not show a concrete attack beyond that.
What the attacker needed
A logged-in account
The fix
The server-side email validation should be improved to reject null bytes and other invalid characters.
How it was found
- Open the user's email settings page on the site.
- Enter an email address containing a null byte or another invalid character.
- Use the browser inspector to change the field type from email to text.
- Submit the form to add the email address.
- Observe the error message, then reload the page and see the email listed.
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 should check the data you send it, not just what the browser shows. Here the email form let through characters that are not allowed in an email address, and the server saved them anyway. The reporter says the server-side check needs to be stronger.
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.