Security experts from Trustwave detailed the Living Off the Land technique that could allow a threat actor to abuse the MS Teams Updater to download any binary or malicious payload from a remote server.
The bad news is that the issue could not be easily addressed because it is a design flaw.
The solution previously proposed to address the Teams issue consists in restricting its ability to update via a URL. Instead, the updater allows local connections via a share or local folder for product updates.
“As per the patch, Microsoft Teams Updater will allow only local network paths to access and update, that means it will detect the string “http/s”, “:”, “/” and port numbers in the updater URL, blocks and log the activity under %localappdata%\Microsoft\Teams\SquirrelSetup.log.” reads the analysis published by Trustwave.
The mechanism allows share access in the local UNC format: \\server\
An attacker could exploit it if the following conditions are met:
Experts noticed that this attack scenario is not easy to implement.
To simplify the attack chain, an attacker can create a remote rather than local share. In this way, the attacker can download the remote payload and execute it without accessing to a local share.
To create a remote share, the experts set up a Samba server that allowed remote public access, the they were able to download the remote payload and run it from Microsoft Teams Updater “Update.Exe” using the following command:
Microsoft Teams leverages the open-source project Squirrel for installation and updating routines. Squirrel relies on NuGet package manager to create the necessary files.
The payload needs to have the name “squirrel.exe” and have to be placed in a particular nupkg file. The file has to be crafted using the metadata of the fake Microsoft Teams release and the installation is in the AppData folder, which does not require increased privileges for access.
The post published by Trustwave includes a step by step procedure to carry out the attack to bypass the current mitigations in the application.
Below the steps to reproduce the attack:
After some seconds (wait for 10-15 seconds), the payload will be downloaded successfully and executed by Microsoft Teams.
The researcher Reegun Jayapaul from Trustwave attempted to report the issue to Microsoft the provide the following reply:
“Thank you again for submitting this issue to Microsoft. We determined that this behavior is considered to be by design as “we cannot restrict SMB source for –update because we have customers that apparently rely on this (e.g. folder redirection)” replied Microsoft
Possible mitigations include monitoring “update.exe” command lines for dubious connections and checking anomalies in the size and the hash of “squirrel.exe.”
Tracking SMB connections, especially those from Microsoft Teams’ updater, could allow us to detect malicious activities.
(SecurityAffairs – hacking, Microsoft Teams)