Skip to content
XSS Write-up Intermediate

CVE-2024-23724: Ghost CMS Stored XSS Leading to Owner Takeover

Ghost CMS accepted SVG profile images without sanitisation, allowing a low-privileged user to upload an SVG containing JavaScript. When another staff member viewed the image's direct URL, the script ran in their browser, and the researchers showed it could add the Administrator role to the attacker and transfer Owner privileges.

Tyler Ramsbey Follow

Published on rhinosecuritylabs.com

During research on the Ghost CMS application, the Rhino research team identified a Stored Cross-Site Scripting (XSS) vulnerability which can be triggered by a malicious profile image. This can be used for Ghost CMS instance takeover–providing an adversary with sole ownership of the Ghost CMS instance.

Tyler Ramsbey, 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

The file upload middleware for profile pictures did not sanitise SVG content, so embedded JavaScript was stored and later executed when the file was viewed directly.

Impact

An attacker with any staff role could take over the Owner account, gaining sole ownership that other admins cannot delete and access to billing details, but the exploit required the Owner to open the SVG's direct URL.

What the attacker needed

Any staff account, e.g. Contributor; victim (Owner) opens the SVG URL; attacker knows the Admin role ID

How it was found

  1. Log in with any user role, including Contributor.
  2. Navigate to the profile page and upload a malicious SVG as the profile image.
  3. Obtain the direct URL provided for viewing the uploaded SVG.
  4. Get the Owner to navigate directly to that URL, causing the JavaScript to execute.
  5. The script adds the Administrator role to the attacker's user and transfers the Owner role to that user.

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.

An SVG is a picture format that can also contain code, like a tiny web page. Ghost CMS let users upload SVGs as profile pictures without cleaning them, so a low-level user could hide JavaScript in their picture. If a more powerful user opened that picture directly, the hidden code ran in their browser and could change their account settings.

What is XSS?

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

More by Tyler Ramsbey

View all

2 more disclosed reports, best first.

More from Ghost

View all

The newest disclosed reports for this program.

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.