| शीर्षक | mtrano (Michele Trancossi) APENCMS latest (main branch, cms/weasel.php) Code Injection / SSTI (CWE-94) |
|---|
| विवरण | APENCMS WeaselCMS template engine uses eval() unsafely, allowing server-side template injection leading to remote code
execution.
cms/weasel.php lines 117-128:
function WeaselCMS($_CMS) {
$template = file_get_contents(
'theme/'.$_CMS['site']['theme'].'/index.html'
);
$template = preg_replace('/{{ (.*?) }}/', '<?= $1; ?>', $template);
$output = preg_replace($minify_search, $minify_replace, $template);
eval("?> $output <?php ");
}
The preg_replace converts {{ ... }} placeholders into executable PHP short echo tags, then the result is passed
directly to eval() without sanitization. An administrator (default credentials admin/password in cms/config.php) can
inject {{ system('id') }} into page content, which executes arbitrary PHP code when any visitor loads the page.
The same vulnerability exists in cms/weaselcms.php (identical code).
PoC: Login as admin, create a page with content {{ system("id; uname -a") }}, visit the frontend page to trigger code
execution.
CVSS 3.1: 9.8 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) |
|---|
| स्रोत | ⚠️ https://github.com/mtrano/apencms |
|---|
| उपयोगकर्ता | milocat (UID 99840) |
|---|
| सबमिशन | 20/07/2026 05:09 AM (2 महीनों पहले) |
|---|
| संयम | 22/09/2026 08:31 AM (2 months later) |
|---|
| स्थिति | स्वीकृत |
|---|
| VulDB प्रविष्टि | 408349 [mtrano APENCMS तक 6546096d354153309693efabb9a0d824628ed4f5 Template Engine cms/weasel.php eval $_CMS['site'] अधिकार वृद्धि] |
|---|
| अंक | 20 |
|---|