Lightdash - Stored Cross-Site Scripting
High8.7CVE-2024-6585 · Published Aug 29, 2024
### Summary Multiple stored cross-site scripting (“XSS”) vulnerabilities in the markdown dashboard and dashboard comment functionality of Lightdash version 0.1024.6 allows remote authenticated threat actors to inject malicious scripts into vulnerable web pages. A threat actor could potentially exploit this vulnerability to store malicious JavaScript which executes in the context of a user’s session with the application. ### Severity **HIGH** - Exploitation of this vulnerability could allow a threat actor to impersonate a user through request forgery, session hijacking, or an account takeover. In addition, a threat actor could access or exfiltrate any data the victim user can access. ### Proof of Concept Multiple instances of stored XSS exist within the affected version: **Instance 1: Markdown Dashboard** Affected Endpoint (Storage): `PATCH /api/v1/dashboards/<DashboardIdentifier>` Affected Endpoint (Execution): `GET /projects/<ProjectIdentifier>/dashboards/<DashboardIdentifier>/view` Affected Parameters: `content` Reproduction Steps: 1. Log in as a user with the permissions to create a new dashboard and create a markdown dashboard 2. Edit the dashboard and insert the payload `...
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| security-research Product | < 0.1042.2 | 0.1042.2 |
Details and references
### Summary Multiple stored cross-site scripting (“XSS”) vulnerabilities in the markdown dashboard and dashboard comment functionality of Lightdash version 0.1024.6 allows remote authenticated threat actors to inject malicious scripts into vulnerable web pages. A threat actor could potentially exploit this vulnerability to store malicious JavaScript which executes in the context of a user’s session with the application. ### Severity **HIGH** - Exploitation of this vulnerability could allow a threat actor to impersonate a user through request forgery, session hijacking, or an account takeover. In addition, a threat actor could access or exfiltrate any data the victim user can access. ### Proof of Concept Multiple instances of stored XSS exist within the affected version: **Instance 1: Markdown Dashboard** Affected Endpoint (Storage): `PATCH /api/v1/dashboards/<DashboardIdentifier>` Affected Endpoint (Execution): `GET /projects/<ProjectIdentifier>/dashboards/<DashboardIdentifier>/view` Affected Parameters: `content` Reproduction Steps: 1. Log in as a user with the permissions to create a new dashboard and create a markdown dashboard 2. Edit the dashboard and insert the payload `<iframe src=”javascript:alert(document.domain)”>`. Save the dashboard 3. Observe payload execution when the dashboard is loaded. 4. Navigate away, return to the dashboard, and observe that the payload is still executed and was stored by the application. An example request to store an XSS payload in the markdown dashboard is shown below. The XSS will be triggered when viewing the injected dashboard. ``` PATCH /api/v1/dashboards/<DashboardIdentifier> HTTP/2 Host: lightdash-host ... Accept-Language: en-US,en;q=0.9 Priority: u=1, i {"tiles":[{"uuid":"<UniqueIdentifier>","x":0,"y":0,"h":9,"w":15,"type":"markdown","properties":{"title":"title","hideTitle":false,"content":"start\n<iframe src=\"javascript:alert(document.domain)\" style=\"position: absolute;width:0;height:0;border:0;\">frame</iframe>\nend\n"}}],"filters":{"dimensions":[],"metrics":[],"tableCalculations":[]},"name":"my dashboard"} ``` **Instance 2: Dashboard Comments** Affected Endpoint (Storage): `POST /api/v1/comments/dashboards/<DashboardIdentifier>/<UniqueIdentifier>` Affected Endpoint (Execution): `GET /projects/<ProjectIdentifier>/<DashboardIdentifier>/view` Affected Parameters: `textHtml` Reproduction Steps: 1. Log into the application and navigate to a shared dashboard 2. Use the dashboard comment functionality to add a new comment. Optional: use the comment `@` functionality to target a potential victim account 3. Intercept the request with Burp Suite and insert the payload `<details/open/ontoggle=alert(document.domain)>` into the value of `textHtml` 4. Forward the request and observe that the payload executes when viewing the dashboard comments An example HTTP request to store the XSS payload in a comment is shown below. After submitting the comment the XSS will be triggered when viewing dashboard comments. ``` POST /api/v1/comments/dashboards/<DashboardIdentifier>/<UniqueIdentifier> HTTP/2 Host: lightdash-host ... Accept-Language: en-US,en;q=0.9 Priority: u=1, i {"text":"@<user>","textHtml":"<p><strong><span style=\"color: #228be6; font-weight: 500;\">@user</span></strong> test<details/open/ontoggle=alert(document.domain)></p>","mentions":["<MentionIdentifier>"]} ``` ### Further Analysis A threat actor needs permissions to create dashboards and make dashboard comments, such as those granted with the Administrator or Editor roles. The threat actor must only identify the affected scope, submit the XSS payload, and wait for an unsuspecting user to visit the affected page. The application contains functionality to tag users and notify them of new comments, which increases the likelihood of a user browsing to a page and triggering payload execution. This vulnerability can be used to force a user to export a dashboar
- CVSS 3.1
- CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N
- Severity from
- GitHub (reviewed advisory)
- Weakness
- CWE-79
More Google advisories
All Google| Date | Advisory | Severity | Fixed in |
|---|---|---|---|
| Oct 12024 | OpenTelemetry: AWS Firehose Receiver Vulnerability | Medium5.3 | v0.108.0 |
| Sep 132024 | Eaton: Hardcoded SSH root password in XC-303 firmware | Critical9.1 | 3.5.17Build715 |
| Sep 62024 | Pi-hole: Web Authentication ByPass | High | No fix yet |
| Aug 292024 | Lightdash - Server-Side Request Forgery Session Takeover | High7.3 | 0.1027.2 |
| Aug 192024 | Open Broadcaster Software (OBS): Heap Overflow Vulnerability | High | 30.2.1+ |
| Aug 142024 | LibRaw: Out of bounds write in LibRaw::sonyParseSR2 | Medium | No fix yet |