Skip to content
XSS Write-up Intermediate

CVE-2025–52367: Stored XSS to RCE via Privilege Escalation in P

A stored cross-site scripting flaw in the title and subtitle fields of PivotX pages let any authenticated user run JavaScript in the browser of anyone viewing the page, including administrators. By stealing an administrator's session cookie, an attacker could take over the admin account and then use the built-in file editor to modify PHP files and achieve remote code execution.

HayToN Follow

Published on medium.com

Upon searching for some CMS to research and testing my web exploitation skills, I came across PivotX, an older flat-file CMS with minimal protection mechanisms. I began exploring its page creation workflow, looking out for any XSS, CSRF and other vulnerabilities that could be made.

HayToN, on medium.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 saved page fields such as title and subtitle without server-side sanitisation and later rendered them directly into HTML, while relying on client-side TinyMCE encoding for other fields.

Impact

An attacker could steal an administrator's session cookie to hijack the admin account, and from there modify PHP files to achieve remote code execution; the text notes the cookie theft redirects the victim's browser, which is noticeable.

What the attacker needed

A normal user account; victim (admin) views the page; attacker hosts a script on their own server

The fix

The report recommends always sanitising and escaping user inputs server-side, applying output encoding when rendering untrusted content, using auto-escaping templating, and applying consistent sanitisation across all editable fields; it does not state that a fix was released.

How it was found

  1. Create a normal user account in the CMS.
  2. Log in as the normal user and create a new page.
  3. Inject a script payload into the subtitle field and save the page.
  4. Log in as an administrator and view the published page, causing the script to run.
  5. Capture the administrator's session cookie sent to the attacker's server.
  6. Use the stolen cookie to access the admin session, then edit a PHP file via the admin file editor to execute 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.

A stored cross-site scripting (XSS) bug means a website saves harmful code that a user types in and later shows it to other visitors without cleaning it. Here, a low-privileged user could put JavaScript into a page's title or subtitle, and when an administrator opened that page, the code ran in the admin's browser. That let the attacker steal the admin's login cookie and then use an admin-only file editor to 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.