2023 Microsoft Office XSS
The Office media service inserted a video's title into an iframe's title attribute without validation, allowing an attacker to inject an onload handler. When a victim played the embedded video in Word, arbitrary JavaScript executed in Edge WebView.
## 2023 Microsoft Office XSS
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
Impact
An attacker could execute arbitrary JavaScript when a victim played an embedded video, and this could potentially be chained with a vulnerable URI scheme to achieve remote code execution.
What the attacker needed
Victim opens a crafted Word document; victim plays the embedded video; attacker controls a YouTube video title; attacker hosts a CORS-enabled server
The fix
The vulnerability was patched in the latest release.
How it was found
- Create a YouTube video whose title contains a payload that breaks out of the title attribute and adds an onload handler.
- In Word, use the Online Videos tab to insert the URL of the malicious video into a document.
- Host a CORS-enabled web server that serves malicious JavaScript, which the onload handler fetches and executes.
- Play the embedded video in Word to trigger the injected JavaScript.
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 you embed a YouTube video in Word, Word asks a Microsoft server for details about the video, including its title. That server put the title straight into a web page without cleaning it, so a video title containing special characters could add its own code. When the video was played, that code ran inside Word's built-in browser.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.