$XXXX with Microsoft Hall of Fame | Microsoft CSP Bypass | Stored XSS on SharePoint | Microsoft Bug Bounty
A stored cross-site scripting flaw in SharePoint let an attacker inject script through item details that were rendered as JSON across many pages. Because an outdated AngularJS library was allowed by the site's Content Security Policy, the injected code could run and potentially steal tokens for full account takeover.
Published on shadowxploitz.medium.com
As a security researcher, I constantly explore new attack surfaces and test modern web applications for security vulnerabilities. Recently, my research led me to a Stored Cross-Site Scripting (XSS) vulnerability in Microsoft SharePoint, which was further exploitable due to a Content Security Policy (CSP) bypass using…
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 user input stored in item details was not properly escaped when rendered inside JSON across SharePoint pages, and the CSP allowed an outdated AngularJS library with known bypass techniques.
Impact
The stored script could run inside trusted Microsoft applications that embed SharePoint, allowing an attacker to steal access tokens and potentially take over accounts, though the report does not show a live end-to-end theft.
What the attacker needed
Attacker has a SharePoint account; victim opens a shared list or page; victim uses SharePoint or an app embedding it
The fix
The issue was fixed by Microsoft, according to the timeline.
How it was found
- Create a normal list in SharePoint and submit the form.
- Share the newly created list with the victim using the manage access button.
- The victim opens the shared list, which looks normal.
- The attacker updates the item details, using the list title as the payload that loads a vulnerable Angular library and executes code.
- When the victim opens any SharePoint page or an application that embeds SharePoint, the script runs.
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.
Stored cross-site scripting means a website saves harmful input and later shows it to other people, so their browsers run it as if it were part of the site. Here the saved item details were shown inside a data format called JSON, and the site did not escape them properly, so the attacker could break out and add script. A security rule called Content Security Policy normally blocks such scripts, but an old copy of the AngularJS library was allowed and could be abused to run code anyway.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.