How I Found an SMTP Injection Bug & Earned $800 in Just 30 Minutes!
A contact form reflected the user-supplied email address into the outgoing email body without sanitising SMTP control characters, allowing an attacker to inject extra SMTP commands such as additional recipients or BCC lines. The author claims this could be used for email spoofing, phishing and sending malicious attachments.
Published on theindiannetwork.medium.com
Bug bounty hunting is full of surprises, and sometimes, the easiest vulnerabilities can pay the most. This is the story of how I stumbled upon an SMTP Injection bug, reported it, and earned $800 in just half an hour.
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
Likely the application passed user-controlled input directly into SMTP commands without stripping newline characters or validating the email address.
Impact
An attacker could send spoofed emails that appear to come from the company, potentially reaching many customers with phishing messages or malicious attachments.
What the attacker needed
A contact form that sends email; email field reflected in the email body
How it was found
- Find a contact form that sends an automated confirmation email and reflects the entered email address in the email body.
- Submit a normal test message and inspect the resulting email.
- Inject an SMTP payload containing an additional recipient command into the email field.
- Observe that two emails arrive, one at the original address and one at the attacker-controlled address.
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 sends an email on your behalf, it builds the email using the text you typed. If it does not clean that text, you can type special line-break characters that the email server treats as new instructions, such as adding another recipient. This is called SMTP injection, and it can let an attacker send extra emails or make messages look like they came from the company.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.