"Important, Spoofing" - zero-click, wormable, cross-platform remote code execution in Microsoft Teams
A stored cross-site scripting flaw in Microsoft Teams' mention display name allowed an attacker to inject AngularJS expressions that executed when a victim viewed a chat message. This led to zero-click remote code execution on the desktop client and theft of SSO tokens.
Published on github.com
BranchesTags
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 mention displayName field was not properly sanitised, allowing AngularJS expression injection that bypassed filtering with a null byte and escaped the AngularJS sandbox.
Impact
An attacker could achieve zero-click remote code execution on victim devices across platforms, steal SSO tokens, access private conversations and files, and potentially create a worm that spreads within organisations.
What the attacker needed
Attacker can send a message to a user or channel; victim uses Microsoft Teams desktop or web client; no user interaction required
The fix
The bugs were fixed by Microsoft at the end of October 2020.
How it was found
- Type a chat message in either direct communication or channel, mention a user or a custom tag within this chat
- Edit the chat message containing the mention and intercept with a HTTP proxy like Burp Suite
- Modify the displayName parameter in the JSON message structure to include the payload
- Send the modified request to store the XSS payload
- Victim views the chat message, executing the payload
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.
Microsoft Teams had a bug where a specially crafted chat message could run harmful code on a victim's computer just by being viewed. The attacker could steal login tokens and take control of the victim's Teams and other Microsoft accounts.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.