Skip to content
RCE Write-up Intermediate

SSTI leads to RCE on PyroCMS

The PyroCMS admin interface allowed template code in fields such as the role Description, so an authenticated user could run server commands. The author demonstrated this by reading a system file.

cupc4k3 Follow

Published on cupc4k3.lol

Whats is Pyro? Pyro is a content management system (CMS) that was built using the PHP programming language.

CUPC4K3, on cupc4k3.lol

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, user-controlled fields were rendered by the Twig template engine without sanitisation, allowing template expressions to be evaluated.

Impact

An authenticated user with role-editing permissions could execute arbitrary commands on the server, potentially escalating privileges or accessing sensitive files.

What the attacker needed

Authenticated access; permission to edit roles

How it was found

  1. Log in to PyroCMS with an account that can edit roles.
  2. Go to the Users > Roles section and edit the Admin role.
  3. Enter template code in the Description field.
  4. Save the role and observe the command output.

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 template engine fills in placeholders like {{7*7}} to build web pages. If a site puts user input into a template without checking it, the engine may run that input as code. Here, an admin could type template code into a description field and make the server run commands.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by cupc4k3

View all

4 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.