Bug Bounty — Mail Injection
The application inserted user-controlled post titles into transactional emails without HTML encoding, allowing an attacker to inject arbitrary HTML and links. An attacker could register using a victim's email address and then upvote a post with a malicious title, causing the victim to receive a spoofed phishing email.
medium.com
Published on medium.com
I simply started to use the app as a normal user, then after some time I noticed one critical flaw — autologin(in one endpoint tho — autologin didn’t work but username/pass after registering were leaked in respons, and there is no check, you just hit someones mail and boom you are in with someones mail). But of course…
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.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The application failed to HTML-encode user-supplied post titles before embedding them in transactional email templates.
Impact
An attacker could send a well-formatted phishing email from the application's legitimate address to any victim whose email they used to register, potentially tricking the victim into clicking a malicious link.
What the attacker needed
Ability to register with any email address; ability to create and upvote a post
How it was found
- Register an account using the victim's email address, which the application allowed without verification.
- Create a post with a title containing HTML markup, such as a link.
- Upvote the post to trigger a notification email to the post author.
- The victim receives an email containing the injected HTML and link.
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 write-up has not been written yet. The Original tab links to the source.
When a website puts user input into an email, it must treat that input as plain text, not as HTML code. Here, the post title was inserted directly into the email's HTML, so an attacker could add their own links and formatting. The attacker also found they could create an account using someone else's email address, so the phishing email would arrive at the victim's real inbox.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.