Skip to content
XSS Write-up Intermediate

LabKey Server

LabKey Server contained a stored XSS in usernames that executed in the admin portal, a CSRF flaw allowing R script execution via a GET request, and an XXE in SVG-to-PDF conversion enabling file read. Chaining the XSS and CSRF let a low-privileged user run arbitrary commands on the server as an administrator.

rhinosecuritylabs.com

Published on rhinosecuritylabs.com

This blog is a walkthrough of the three different vulnerabilities we discovered in the LabKey Server a biomedical research platform–Stored XSS (CVE-2019-9758), CSRF leading to RCE (CVE-2019-9926), and XXE (CVE-2019-9757) allowing arbitrary file read. By combining the XSS and CSRF vulnerabilities, it was possible to…

David Yesland, on rhinosecuritylabs.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application failed to sanitise usernames before rendering them in admin menus, accepted state-changing requests via GET without CSRF protection, and used an outdated XML parser (Apache Batik) that allowed external entities.

What the attacker needed

A low-privileged user account; administrator views a menu or link; victim clicks a link or loads a page

The fix

The vulnerabilities were fixed in LabKey Server 19.1.1 and backported to older versions.

How it was found

  1. Change a user's username to an XSS payload.
  2. Trigger the payload when an administrator uses the 'Clone permissions from user' menu.
  3. Modify the report execution request from POST to GET and move parameters to the query string.
  4. Send the modified request without a CSRF token to execute an R script command.
  5. Use the XSS to load a JavaScript file that makes the CSRF request, causing the administrator to run a reverse shell.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

This report describes three security bugs in a research data platform. One let a normal user insert a script that ran in an administrator's browser (cross-site scripting), another let an attacker make an administrator's browser send a command to the server without their knowledge (cross-site request forgery), and a third let an attacker read files on the server by abusing how XML is processed (XXE). By combining the first two, an attacker could run commands on the server.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.