Skip to content
XSS Write-up Intermediate

Target Finds Cross-Site Scripting in Microsoft SharePoint

SharePoint's email notification system failed to sanitise the preview text of incoming emails, allowing an attacker to inject script tags that executed in the victim's browser without any interaction. An attacker could send a crafted email to a signed-in user and run arbitrary JavaScript, potentially redirecting them to a fake login page.

Target Follow

Published on tech.target.com

Cross-site scripting has been an OWASP Top 10 classic for more than a decade, but it still comes as a surprise to find it out in the wild, especially in a well-known product. During a recent penetration test, Target's Security Testing Services team found that Microsoft's SharePoint was vulnerable to a unique attack…

Target, on tech.target.com

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 email preview text was embedded into a script block without encoding angle brackets, so an attacker could close the script tag and inject new script.

Impact

An attacker could execute arbitrary JavaScript in a signed-in user's browser and redirect them to a phishing page, with no action needed from the victim beyond receiving the email.

What the attacker needed

Victim signed into SharePoint; attacker can send email to victim; no victim interaction needed

The fix

The issue was fixed by modifying a serializer to properly encode script tags in notifications.

How it was found

  1. Send an email containing a script-closing payload in its body to a SharePoint user.
  2. The victim's browser polls for new mail notifications about once a minute.
  3. The SharePoint server returns the unsanitised preview text inside a script tag.
  4. The injected script executes in the victim's browser, showing an alert and redirecting to a fake login page.

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 receive an email, SharePoint shows a small preview of it in a pop-up notification inside your browser. The problem was that this preview was inserted into the page without cleaning it first, so if the email contained special code, the browser would run it as if it were part of SharePoint itself. This let an attacker run their own code in the victim's browser just by sending an email.

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

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.