Skip to content
IDOR Write-up Advanced

Multiple Vulnerabilities In Cockpit CMS <= V2.5.2

Cockpit CMS had an IDOR in the Content API's populate function that allowed unauthenticated users to read data from other collections by injecting _model and _id attributes, and the admin portal lacked CSRF protection on all API actions, enabling file uploads and RCE. An attacker could exploit these to access sensitive data or execute arbitrary code.

GhostCcamm Follow

Published on ghostccamm.com

So I got bored again and decided to look at another open-source CMS project in the little hobby hacking time I had outside of work. The project that caught my attention was Cockpit CMS, a headless CMS that is written in PHP.

GhostCcamm (@GhostCcamm), on ghostccamm.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

Impact

An attacker could read sensitive data from other collections and, by chaining CSRF with file uploads, achieve XSS or RCE, though some mitigations like allowed uploads and removed writeFile limited the exploit.

What the attacker needed

Cockpit CMS <= 2.5.2; public write access to a collection; victim admin visits malicious site; ability to upload files

The fix

The IDOR was fixed by adding an allowedModels check in the populate function, and CSRF protection was added to the admin API; however, input type validation was not implemented.

How it was found

  1. Create a collection with a relational field linking to another collection.
  2. As an unauthenticated user, create an item and inject _model and _id attributes into a field.
  3. Request the item with ?populate=1 to trigger the vulnerable populate function and retrieve data from the linked model.
  4. For CSRF, craft a malicious website that submits a form to an admin API endpoint (e.g., file upload) without a CSRF token.
  5. For CSRF to XSS, upload a large SVG file with JavaScript and quickly access it before sanitisation.
  6. For CSRF to RCE, upload a ZIP file containing a PHP payload and use the unzip action to extract it.

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.

Cockpit CMS is a tool for building websites and APIs. Two problems were found: one let anyone read data they shouldn't by tricking the system into fetching linked records, and another let attackers make a logged-in admin's browser perform actions like uploading files without the admin knowing. Together, these could let an attacker steal data or run malicious code on the server.

What is IDOR?

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.

More by GhostCcamm

View all

1 more disclosed report, best first.

More from Cockpit CMS

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Insecure direct object reference (IDOR)

The lesson behind this report.

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.