2022 Microsoft Teams RCE
The Microsoft Teams deep link handler for /l/task/:appId allowed loading an arbitrary URL in a webview by bypassing the domain allowlist using URL encoding. An attacker could then exploit the pluginHost RPC interface to execute arbitrary code outside the sandbox.
## 2022 Microsoft Teams RCE
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 URL allowlist check was performed on the original encoded URL, but the URL was decoded before being loaded, allowing a crafted URL to pass the check and then resolve to an attacker-controlled domain.
Impact
An attacker could execute arbitrary code on the victim's machine outside the sandbox, but the exploit requires the victim to click a crafted link.
What the attacker needed
Victim clicks a link; Microsoft Teams installed
How it was found
- Craft a URL with the /l/task/ path and a url parameter that uses URL encoding to bypass the allowlist.
- Send the crafted URL to a victim (e.g., via a chat message).
- The victim clicks the link, and Teams loads the attacker's page in a webview.
- The attacker's page exploits prototype pollution to access Electron IPC modules.
- The page sends IPC messages to the pluginHost to execute arbitrary code.
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 has a feature that lets apps open web pages inside the Teams window. The check that ensures only approved websites are opened could be tricked by encoding a special character in the web address. Once a malicious page was loaded, it could talk to other parts of Teams and run programs on the computer.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.