Skip to content
XSS Write-up Beginner

Html Injection In An Email Template

Email templates used by several companies reflected user-supplied form values without adequate sanitisation, so an attacker could inject HTML into emails sent from the company's own address. This could let the attacker redirect recipients to fraudulent sites or push them to take unwanted actions.

Rachid.A Follow

Published on infosecwriteups.com

Send emails on behalf of a company? Here’s how I found this vulnerability in several large companies allowing me to easily earn bounties.

Rachid.A, on infosecwriteups.com

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 embedded user-controlled form values into the email template without sanitising or encoding them.

Impact

An attacker could send emails from the company's address containing injected HTML, potentially redirecting recipients to fraudulent sites or pushing them to perform unwanted actions; programs generally rate this low to medium.

What the attacker needed

A feature that sends emails; input reflected in the email; ability to choose the recipient

How it was found

  1. Find a feature that sends emails, such as a contact or help form.
  2. Submit the form and check whether an email arrives.
  3. Check whether you can choose the recipient address, or intercept the request and change it.
  4. Check whether values you entered are reflected in the received email.
  5. Inject simple HTML such as a bold tag and see whether it is rendered in the email.
  6. If front-end filters block special characters, submit random values, intercept the request and send payloads from the proxy.

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 takes what you type into a form and puts it into an email without cleaning it first, you can type formatting or link code that the email then displays. Because the email comes from the company's real address, people trust it, so a fake link inside it is more likely to be clicked. This is called HTML injection.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.