Skip to content
CVE-2026-138223 Google Chronicle · YARA-L

Detect David-Crty Databasement Toast Trait Template Injection / Code Execution (CVE-2026-138223) in Google Chronicle

Detects exploitation attempts and post-exploitation indicators for CVE-2026-138223, a critical (CVSS 10.0) vulnerability in David-Crty Databasement up to and including version 1.7.12. The flaw resides in the toast() function of app/Traits/Toast.php. The weakness is categorized as CWE-791 (incomplete filtering of special elements) and CWE-1336 (improper neutralization of special elements used in a template engine), indicating that attacker-controlled input flowing into the toast notification/flash-message mechanism can be interpreted by the underlying template engine (server-side template injection) leading to arbitrary code execution. Exploitation is currently theoretical (no public PoC), but the fix in v1.7.13 (commit 713f71f5336663493e8c4dc07e7f3e96a291775b) confirms the sink. This detection looks for suspicious template-expression payloads reaching Databasement web endpoints and anomalous child processes spawned by the PHP/web runtime hosting the application.

MITRE ATT&CK

Tactic
Initial Access Execution

YARA-L Detection Query

Google Chronicle (YARA-L)
yaral
// df00tech DF00-1a9be87617 · https://df00tech.com/detections/CVE-2026-138223 · licence: https://df00tech.com/detections/licence
rule databasement_toast_ssti_cve_2026_138223 {
  meta:
    author = "Argus Detection Platform"
    description = "Databasement toast() template injection attempts (CVE-2026-138223)"
    severity = "CRITICAL"
  events:
    $e.metadata.event_type = "NETWORK_HTTP"
    (
      re.regex($e.network.http.referral_url, `(?i)databasement|toast|flash`) or
      re.regex($e.target.url, `(?i)databasement|toast|flash`)
    )
    re.regex($e.target.url, `(?i)(\{\{|\$\{|_self|__class__|shell_exec|system\(|passthru\()`)
    $ip = $e.principal.ip
  match:
    $ip over 5m
  condition:
    $e
}
critical severity medium confidence

Chronicle YARA-L rule detecting template injection payloads directed at the Databasement toast endpoint.

Data Sources

Web Server LogsNetwork HTTP Events

Required Tables

NETWORK_HTTP

False Positives & Tuning

  • Authorized scanning infrastructure probing the application
  • Internal test traffic with brace characters
  • Legitimate URLs embedding literal template tokens

Other platforms for CVE-2026-138223


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 SSTI probe against toast endpoint

    Expected signal: Web server access log entry with URL query containing {{7*7}} to the toast endpoint.

  2. Test 2 SSTI RCE primitive payload

    Expected signal: Web access/body log containing shell_exec/system/@php tokens targeting the toast sink.

  3. Test 3 Web runtime spawns shell (post-exploitation)

    Expected signal: Process-creation event showing bash/id/whoami with parent php-fpm/apache under the web service account.


Response Playbook

Triage

  1. Confirm the Databasement application version in scope; versions <= 1.7.12 are vulnerable and must be upgraded to 1.7.13 or later.
  2. Decode the flagged HTTP request parameter and determine whether the payload contains an executable template expression (e.g., {{7*7}}, ${...}, _self.env, registerUndefinedFilterCallback) versus benign brace content.
  3. Correlate the source IP's request history to establish whether this is a single probe, a scan, or a sustained exploitation attempt.
  4. Check the web/application logs for the HTTP response status and size returned to the suspicious request to gauge whether injection was reflected or evaluated.

Containment

  1. Deploy a WAF rule or reverse-proxy filter blocking template meta-characters ({{, ${, _self, __class__) on Databasement toast/flash parameters as an immediate mitigation.
  2. Upgrade affected Databasement instances to v1.7.13 or later, which remediates the toast() sink; if upgrade is not immediately possible, take the exposed endpoint offline.
  3. Isolate any host where a web-runtime-spawned shell process was observed until forensic review completes.

Evidence Collection

  1. Preserve raw web server access logs (IIS/Apache/Nginx) covering the suspicious requests, including full URL query strings and bodies.
  2. Capture the application's PHP error/debug logs and any flash-message/session storage that may contain the rendered payload.
  3. Collect endpoint process-creation telemetry and command-line arguments for any child process of php/php-fpm/httpd during the suspected exploitation window.

Escalation Criteria

  • !Escalate to incident response immediately if a shell, interpreter, or reconnaissance binary was spawned by the web runtime following the suspicious request.
  • !Escalate if evidence shows the template expression was evaluated (e.g., response reflects computed arithmetic or system command output), indicating confirmed RCE.

Investigation Guide

Forensic Artifacts

  • >Web server access logs containing the injected template payload in the URL/query/body
  • >PHP-FPM / Apache process-creation events showing anomalous child shell processes
  • >Application flash-message/session artifacts persisting the attacker-supplied toast content

Tuning Guidance

Baseline legitimate use of curly braces in your Databasement content before enabling blocking. In environments with active security scanning, exclude known scanner source IPs. Tighten the KQL/SPL web-log rules to match only the specific toast/flash parameter names used by your deployment, and pair the web-log detections with the EQL/CQL process-spawn rules to escalate confirmed code execution over mere probing.


Hunting Queries

Identifies source IPs repeatedly sending template-injection candidate payloads, indicative of fuzzing or exploitation.

Hunting — KQL
kql
// df00tech DF00-1a9be87617 · https://df00tech.com/detections/CVE-2026-138223 · licence: https://df00tech.com/detections/licence
W3CIISLog | where cs_uri_query has_any ('{{','${','_self','shell_exec') | summarize count() by cIP, bin(TimeGenerated, 1h) | where count_ > 5
Hunting — SPL
spl
``` df00tech DF00-1a9be87617 · https://df00tech.com/detections/CVE-2026-138223 · licence: https://df00tech.com/detections/licence ```
index=web (uri_query="*{{*" OR uri_query="*${*" OR uri_query="*_self*") | stats count by src_ip | where count>5

Atomic Red Team Tests

Test 1 SSTI probe against toast endpoint
linux

Sends a benign arithmetic template expression to the Databasement toast/flash parameter to simulate an SSTI probe.

Command

bash
curl -s 'http://localhost:8080/databasement/toast?message=%7B%7B7*7%7D%7D'

Cleanup

bash
echo 'No cleanup required; stateless GET request.'

Expected Telemetry

Web server access log entry with URL query containing {{7*7}} to the toast endpoint.

Expected Detection

KQL/SPL/QRadar/Sumo/Chronicle web-log rules flag the request for template meta-characters.

Test 2 SSTI RCE primitive payload
linux

Sends a template payload invoking a PHP command-execution function to simulate attempted code execution.

Command

bash
curl -s --data 'message=${@php(system("id"))}' 'http://localhost:8080/databasement/toast'

Cleanup

bash
echo 'No cleanup required; stateless POST request.'

Expected Telemetry

Web access/body log containing shell_exec/system/@php tokens targeting the toast sink.

Expected Detection

Web-log detections match the RCE primitive keywords and raise a critical alert.

Test 3 Web runtime spawns shell (post-exploitation)
linux

Simulates the post-exploitation signal of the PHP runtime spawning a shell, as would occur after successful toast() injection.

Command

bash
sudo -u www-data bash -c 'id; whoami'

Cleanup

bash
echo 'No persistent changes made.'

Expected Telemetry

Process-creation event showing bash/id/whoami with parent php-fpm/apache under the web service account.

Expected Detection

Elastic EQL sequence and CrowdStrike CQL process rules detect the web-runtime-spawned shell.

Related Detections