Outlook — Stored XSS In “attachment.office” Domain via SVG file
An SVG file attached to an email and stored on the attachments.office.net domain could contain a script that executes when the file's link is opened. An attacker could send the stored link to a victim and run script in the victim's browser on that domain.
I discovered that the application is vulnerable to persistent cross-site scripting (PXSS) attacks.
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 attachment service served user-uploaded SVG files inline without sanitising or blocking embedded scripts.
Impact
An attacker could run script in a victim's browser on the attachments.office.net domain after the victim opens a crafted link.
What the attacker needed
Ability to send an email with an SVG attachment; victim opens the copied attachment link
How it was found
- Create an SVG file that contains a script.
- Email the SVG file to yourself as an attachment.
- Right-click the stored SVG and copy its image link.
- Send that link to the victim; the script runs in the victim's browser.
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.
An SVG is an image format that is really a text file, and it can include instructions that a browser will run as code. Here, the site that stores email attachments did not stop those instructions, so opening a link to the stored image ran the attacker's code in the victim's browser. This is called stored cross-site scripting because the harmful content is saved on the server first.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.