Exploiting Stored HTML Injection via Broken Email Ownership Validation
A profile field accepted HTML that was neutralised in the web interface but rendered as active markup in system-generated emails. Combined with a change-email feature that lacked ownership verification, an attacker could send phishing emails from the legitimate domain to arbitrary addresses.
Published on medium.com
Security assessments often start with a familiar pattern: throw payloads, observe failures, move on. During a recent VAPT engagement, the target application initially appeared exceptionally hardened.
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 inconsistent output encoding between the web interface and the email template, combined with missing verification when changing the account email address.
Impact
An attacker could send convincing phishing emails from the legitimate domain to arbitrary recipients, potentially leading to credential harvesting and reputational damage.
What the attacker needed
An authenticated account; ability to edit profile details; ability to change account email
The fix
The text does not state that the issue was fixed; it should be fixed by sanitising output in every rendering context, treating emails as active content surfaces, and requiring ownership verification for email changes.
How it was found
- Enter basic HTML markup into a profile text field and save it.
- Observe that the web interface displays the input as inert text.
- Review system-generated emails and see the HTML rendered in the email body.
- Use the Change Email function to set the account email to an arbitrary address without verification.
- Trigger application emails so the rendered payload is delivered to the chosen 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.
HTML injection means a website lets you type in code that a browser or email program later treats as part of the page. Here the website cleaned up the text when showing it on the site, but the email system did not, so links appeared in emails. Separately, users could change their account email to any address without proving they owned it, which let an attacker send those emails to other people.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.