Skip to content
XSS Write-up Intermediate

Yahoo Mail stored XSS

A stored XSS vulnerability in Yahoo Mail allowed an attacker to embed malicious JavaScript in an email message, which would execute automatically when the message was viewed. The attacker could then compromise the account, change settings, and forward or send email without the user's consent.

Klikki Oy Follow

Published on klikki.fi

A stored XSS vulnerability in Yahoo Mail was patched earlier this month. The flaw allowed malicious JavaScript code to be embedded in a specially formatted email message.

klikki, on klikki.fi

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 HTML filter removed the value of certain boolean attributes but left the equals sign, so browsers parsed the remaining text as new attributes, allowing an event handler to be injected.

Impact

An attacker could compromise the victim's Yahoo Mail account, change its settings, and forward or send email without consent; the bug affected all webmail versions but not the mobile app.

What the attacker needed

Victim views the crafted email in Yahoo Mail webmail

The fix

The bug was fixed by Yahoo on January 6, 2016.

How it was found

  1. Create an email message containing all known HTML tags and attributes to see which pass the Yahoo filter.
  2. Notice that boolean attributes with values lose the value but keep the equals sign.
  3. Craft an IMG tag with a boolean attribute and a quoted value that includes an event handler.
  4. Send the email; when viewed, the filter transforms it so the event handler becomes an active attribute.
  5. The browser renders the IMG tag and executes the JavaScript without further user interaction.

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.

This is a stored cross-site scripting (XSS) bug. When a victim opened a specially crafted email in Yahoo Mail, the email's HTML was filtered but a flaw let some JavaScript slip through. That JavaScript ran in the victim's browser and could take over their email account.

What is XSS?

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

More by Klikki Oy

View all

1 more disclosed report, best first.

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.