**Abusing Cloud-Based Sandboxes During Lockdown: An Exploration of Microsoft Services**
Microsoft's SharePoint/OneDrive antivirus sandbox executed VBA and VBScript attachments sent via Teams, allowing an attacker to run code and exfiltrate data from Microsoft's infrastructure. The sandbox could also be used as a proxy to attack external systems, making the attack appear to originate from Microsoft IP addresses.
Published on infosecwriteups.com
Four years have passed since I decided to write this article. I have always postponed it for various reasons, but here I am.
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 antivirus sandbox executed active content (VBA macros and VBScript) without sufficient isolation, allowing outbound network connections and code execution.
Impact
An attacker could execute code and exfiltrate data from Microsoft's sandbox, and could use it as a proxy to attack external systems, potentially obscuring the true origin; however, as of 2024, VBScripts no longer run in the sandbox, so this specific technique is no longer exploitable.
What the attacker needed
A Microsoft Teams account; ability to send files via Teams chat; victim does not need to open the file
The fix
Microsoft changed the sandbox behaviour so that VBScripts no longer execute, likely due to VBScript deprecation, which mitigates this specific attack.
How it was found
- Create a malicious file with a VBA macro or VBScript that performs actions like exfiltrating data or launching a reverse shell.
- Send the file as an attachment in a Microsoft Teams chat.
- The Microsoft sandbox automatically executes the file, and the attacker receives connections or data from Microsoft IP addresses.
- For proxying attacks, port an exploit (e.g., for CVE-2013-4810) to VBScript and send it via Teams.
- The sandbox executes the exploit against an external target, making the attack appear to come from Microsoft.
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 send a file through Microsoft Teams, Microsoft scans it for malware using a sandbox, which is an isolated environment. The researcher found that this sandbox actually runs macros and scripts inside the file, so an attacker can make Microsoft's own servers run their code and even attack other computers, hiding the attacker's real location.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.