Skip to content
RCE Write-up Advanced

Threat Modeling

A pre-authenticated remote code execution vulnerability existed in Dedecms v5.8.1 pre-release because the ShowMsg function embedded the unfiltered Referer header into a template that was written to a cache file and then included. An attacker could bypass a deny list of dangerous functions and execute arbitrary code.

srcincite.io

Published on srcincite.io

In this blog post, I’m going to share a technical review of Dedecms (or “Chasing a Dream” CMS as translated to English) including its attack surface and how it differs from other applications. Finally, I will finish off with a pre-authenticated remote code execution vulnerability impacting the v5.8.1 pre-release.

The author, on srcincite.io

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 ShowMsg function used the unfiltered Referer header to build a template string that was cached as a PHP file and included, with only a weak deny list of dangerous functions.

Impact

An unauthenticated attacker could execute arbitrary code on vulnerable versions, but the flaw only affected the pre-release and not the release version.

What the attacker needed

Victim clicks a link; no authentication needed

The fix

The vulnerability was fixed by a silent patch released two days after reporting.

How it was found

  1. Send a request to a vulnerable endpoint such as /plus/flink.php?dopost=save with a crafted Referer header.
  2. The ShowMsg function uses the Referer value to build a template string.
  3. The template string is written to a cache file and then included, executing the attacker's code.

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.

The software took a value from the browser's Referer header and put it into a page template without cleaning it. That template was saved as a PHP file and then run, so an attacker could sneak in code that the server would execute.

What is RCE?

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

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.