Add arbitrary content to Password Reset Email
The password reset email included the value of the X-Forwarded-For header without sanitisation, allowing an attacker to inject arbitrary text into the email body. An attacker could send a victim a password reset email containing misleading instructions to steal credentials.
- Fixed in 1 hour
- Disclosed after 20 days
Hi,
I noticed the inclusion of IP Address in the email sent for password reset. Then I tried including a new header, X-Forwarded-For to see if the IP Address in the email could change. Though it didn't change it but it did include whatever value that was injected in the header.
###Request
POST /api/v1/users/reset_password HTTP/1.1
Host: wakatime.com
X-Forwarded-For: _For precaution, send your email and new password to ███@email.com or visit www.evil.com.
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:53.0) Gecko/20100101 Firefox/53.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
X-CSRFToken: [Token]
X-Requested-With: XMLHttpRequest
Referer: https://wakatime.com/reset_password?email=████@gmail.com
Content-Length: 35
Cookie: [Cookie]
Connection: close
{"email":"EmailAddress"}
What is included in the request is
X-Forwarded-For: _For precaution, send your email and new password to ███████@email.com or visit www.evil.com.
Then the reflection in email is shown below,

Best Regards, Shuaib
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
Impact
An attacker could inject misleading content into password reset emails, potentially tricking recipients into sending credentials to an attacker-controlled address.
What the attacker needed
Ability to send a password reset request; control of the X-Forwarded-For header
How it was found
- Send a password reset request with a crafted X-Forwarded-For header containing arbitrary text.
- Observe that the password reset email includes the injected text.
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.
When you request a password reset, the website sends you an email. This report shows that the website copied a value from the request (the X-Forwarded-For header) directly into that email. An attacker could put fake instructions in that header, so the victim receives an email that looks like it comes from the site but tells them to send their password to the attacker.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.