Header Injection to Hero: How I Hijacked Emails and Made the Serv
An email feedback endpoint failed to sanitise the email field, allowing newline injection into SMTP headers. An attacker could inject CC or BCC headers to receive copies of internal emails, spoof the sender and subject, and potentially trigger bouncebacks that leak internal information.
Free Link 🎈
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
Impact
An attacker could receive copies of internal emails, spoof the sender and subject to phish staff, and potentially obtain internal information from bouncebacks.
What the attacker needed
Access to the feedback form; ability to send POST requests
The fix
The application should sanitise or reject newline characters in the email field before using it in SMTP headers.
How it was found
- Find the feedback endpoint that sends emails.
- Submit a normal request to confirm emails are delivered.
- Inject a newline followed by a CC header in the email field.
- Observe that the attacker receives a copy of the email.
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, it builds the email's header lines (like To, From, Subject) from your input. If it doesn't clean that input, you can sneak in extra header lines by using a newline character. Here the email field was not cleaned, so the attacker could add a CC line and get a copy of the email.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.