Stored XSS on search bar in External Share for Confluence
Description
Stored Cross-Site Scripting (XSS) is a type of injection attack where malicious JavaScript is injected into a website. When a user visits the affected web page, the JavaScript executes within that user’s browser in the context of this domain. Stored XSS can be found on this domain which allows an attacker to submit data to a form and escalate from no privileges to any user type, which could include an Administrator level user.
When an attacker can control code that is executed within a user’s browser, they are able to carry out any actions that the user is able to perform, including accessing any of the user's data and modifying information within the user’s permissions. This can result in modification, deletion, or theft of data, including accessing or deleting files, or stealing session cookies which an attacker could use to hijack a user’s session.
Business Impact
Stored XSS could lead to data theft through the attacker’s ability to manipulate data through their access to the application, and their ability to interact with other users, including performing other malicious attacks, which would appear to originate from a legitimate user. These malicious actions could also result in reputational damage for the business through the impact to customers’ trust.
Steps to Reproduce
-
Setup Confluence Cloud and install External Share app.
-
Create a new page in any Confluence space as the parent page:
-
Click
Createbutton on the top bar, selectPage. -
Give the page a title.
-
Publish the page.
-
-
Create a child page under the parent page with XSS payload:
-
Still on the published page, click
Createbutton on the top bar, selectPage. -
Enter the following encoded XSS payload as the title:
Bugcrowd <img src onerror="alert('XSS! at '+origin)"> -
Publish the page.
-
-
Create
External Sharein the parent page withSearch pagesenabled:-
Go to the parent page.
-
Under the page title, click the yellow paper plane icon (External Share).
-
Click
Create External Share Linkbutton. -
Tick the
Share child pagescheckbox. -
Tick the
Search pagescheckbox.
-
-
Trigger the XSS:
-
Open the external share link (from the URL field).
-
Observe the search bar on top-right.
-
Enter
Bugcrowdin the search bar to find the XSS page. -
An alert will pop up, confirming JavaScript is executed.
-
QA pass done. The issue could not be reproduced on QA ESFC either with the original payload or around 100 other payloads from this list).
For reference I am linking a share that I used for tests: https://esfc.app.qa1.pl/content/b493696e-4c2d-4bf1-8626-9d288615d061