Microsoft Office 365 - Outlook XSS
Outlook allowed an attacker to inject JavaScript into emails via a crafted SVG emoji in the signature and via a malicious vCalendar meeting link. An attacker could execute arbitrary script in the victim's browser when the victim views the email or clicks the meeting link.
Published on leucosite.com
Outlook was the first website I have found and participated in a bug bounty for back in 2015. I ended up finding several bugs which I have showcased here (updated videos.)
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 failed to properly sanitise user-supplied content (emoji images and calendar URLs) before rendering it in the browser.
Impact
An attacker could execute arbitrary JavaScript in the victim's Outlook session, potentially leading to data theft or account compromise.
What the attacker needed
Outlook account; Victim opens email or clicks meeting link
How it was found
- Create an email signature containing an emoji.
- Observe that the emoji is stored as a base64-encoded image tag in the email body.
- Replace the emoji image with a base64-encoded SVG containing JavaScript.
- Send the email and open the attachment URL, which renders the SVG inline.
- Use the same attachment ID and token on the main outlook.office.com domain to execute the script in scope.
- For the calendar bug, export a forwarded meeting to obtain the generated vCalendar data.
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.
Cross-site scripting (XSS) is when an attacker sneaks their own JavaScript code into a trusted website, so it runs in a victim's browser. Here, Outlook let the attacker put code inside an image or a calendar link, and when the victim opened the email or clicked the meeting button, that code ran as if Outlook itself had sent it.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.