Skip to content
XSS Write-up Intermediate

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.

adm1nkyj Follow

Published on blog.pksecurity.io

## 2023 Microsoft Office XSS

PKSecurity, on blog.pksecurity.io

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

  1. Create a YouTube video whose title contains a payload that breaks out of the title attribute and adds an onload handler.
  2. In Word, use the Online Videos tab to insert the URL of the malicious video into a document.
  3. Host a CORS-enabled web server that serves malicious JavaScript, which the onload handler fetches and executes.
  4. 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.

More from Microsoft (Office)

View all

The newest disclosed reports for this program.

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.