CVE-2026-55792
PHP vulnerability analysis and mitigation

Overview

CVE-2026-55792 is a sensitive file disclosure / server-side file read vulnerability in Craft CMS affecting versions 4.0.0-RC1 through 4.17.x and 5.0.0-RC1 through 5.9.x. The flaw allows any control panel user with the utility:system-messages permission to embed a dataUrl() Twig payload into system email templates, causing the server to read and exfiltrate arbitrary files — including the .env file — as base64-encoded data URLs in outbound emails. The vulnerability was first published on June 16, 2026 (GitHub Advisory), with NVD publication on July 1, 2026, and patched versions released as 4.18.0 and 5.10.0. It carries a CVSS v4.0 base score of 6.0 (Medium) (Github Advisory).

Technical details

The root cause (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) stems from three compounding code facts: (1) the dataUrl() Twig function is explicitly included in Craft's Twig sandbox allowlist (src/config/twig-sandbox.php, line 115); (2) the Html::dataUrl() helper in src/helpers/Html.php applies four file-access checks (must be within project root, not in system directories, not a .php file, and must exist) — none of which block dotfiles like .env; and (3) system message bodies are rendered via renderSandboxedString() in src/mail/Mailer.php, executing any saved Twig content including dataUrl() calls when emails are sent. Because the utility:system-messages permission is a non-admin control panel permission grantable to any user group, the attack surface extends beyond administrators. The exploit was confirmed against Craft CMS 5.9.19 (Github Advisory).

Impact

Successful exploitation results in full exfiltration of the server-side .env file, which typically contains the database password, CRAFT_SECURITY_KEY, and third-party API keys. Obtaining CRAFT_SECURITY_KEY enables an attacker to forge valid session tokens and escalate privileges to full admin account takeover, effectively compromising the entire Craft CMS installation. Secondary impacts include unauthorized database access and potential compromise of any third-party services whose API keys are stored in .env (Github Advisory).

Exploitability

CISA's SSVC assessment classifies this vulnerability with exploitation status of "poc" and technical impact of "total," though it is not listed in the CISA KEV catalog (NVD). The EPSS score is approximately 0.268% (19th percentile), indicating a relatively low but non-negligible probability of exploitation in the near term (Github Advisory). No public proof-of-concept exploit code has been confirmed, and there is no evidence of active in-the-wild exploitation at this time. Exploitation is not automatable and requires an attacker to already possess a control panel account with the utility:system-messages permission.

Exploitation steps

  1. Obtain access: Acquire a Craft CMS control panel account with the utility:system-messages permission (e.g., through credential theft, phishing, or a compromised low-privilege account).
  2. Navigate to system messages: Log into the Craft CMS control panel and navigate to Utilities > System Messages.
  3. Inject the payload: Edit any system email template (e.g., the account activation email) and insert a dataUrl() Twig payload targeting the .env file in the body field, for example: {{ dataUrl('@root/.env') }}.
  4. Trigger email sending: Save the template and trigger the email to be sent (e.g., by initiating a password reset or account activation for a test user), causing the server to execute the Twig template via renderSandboxedString().
  5. Retrieve exfiltrated data: Receive the outbound email, which will contain the .env file contents embedded as a data:text/plain;base64,... URL in the email body; decode the base64 string to recover plaintext credentials.
  6. Escalate privileges: Use the extracted CRAFT_SECURITY_KEY to forge a valid session token for an admin account, achieving full administrative control of the Craft CMS instance (Github Advisory).

Indicators of compromise

  • Logs: Craft CMS application logs showing system email sends triggered by non-admin users with the utility:system-messages permission, particularly outside normal business hours or for unusual recipient addresses.
  • Logs: Email delivery logs containing outbound messages with unusually large or base64-heavy bodies (indicative of embedded file contents as data URLs).
  • File System: Review of system message templates in the database for the presence of dataUrl() Twig function calls, especially referencing paths like .env, /../, or other sensitive files.
  • Network: Outbound SMTP traffic from the Craft CMS server containing data:text/plain;base64, strings in email bodies, which may be visible in mail server logs or email gateway inspection.
  • Logs: Audit log entries in Craft CMS showing edits to system messages by non-admin users, followed shortly by email-triggering actions (Github Advisory).

Mitigation and workarounds

Upgrade Craft CMS to version 4.18.0 or 5.10.0, which resolve the vulnerability by removing dataUrl() from the Twig sandbox allowlist or adding explicit dotfile/.env protections. As an immediate workaround, restrict the utility:system-messages permission to only fully trusted administrators via Settings > Users > Groups. If the .env file may have been exposed, rotate the CRAFT_SECURITY_KEY, database credentials, and all third-party API keys stored in .env immediately, and invalidate all active sessions (Github Advisory).

Community reactions

The vulnerability was reported by security researcher smakarim and published as a GitHub Security Advisory (GHSA-287w-mxq6-x2cp) on June 16, 2026. CISA-ADP added the vulnerability to NVD records on July 2, 2026, classifying it with a technical impact of "total" in their SSVC assessment. Social media activity was limited to automated CVE notification accounts on Bluesky and Nitter shortly after publication, with no notable independent researcher commentary or significant media coverage identified (Github Advisory).

Additional resources

  • Github Advisory — Official GitHub Security Advisory (GHSA-287w-mxq6-x2cp)
  • CraftCMS Advisory — Craft CMS repository security advisory with full technical details
  • OSV Database — OSV.dev entry for GHSA-287w-mxq6-x2cp
  • ENISA EUVD — ENISA European Vulnerability Database entry (EUVD-2026-41212)
  • GitLab Advisory — GitLab advisory for craftcms/cms

SourceThis report was generated using AI

Related PHP vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-59989CRITICAL9.2
  • PHP logoPHP
  • phalcon/cphalcon
NoYesAug 21, 2026
CVE-2026-63135HIGH8.2
  • PHP logoPHP
  • yourls/yourls
NoYesAug 21, 2026
GHSA-p2ch-c2c3-4xm5MEDIUM6.1
  • PHP logoPHP
  • winter/wn-backend-module
NoYesAug 20, 2026
GHSA-8hgv-xc77-jmcrMEDIUM5.1
  • PHP logoPHP
  • getgrav/grav
NoYesAug 21, 2026
GHSA-hq84-x37p-j6q5MEDIUM4.5
  • PHP logoPHP
  • winter/wn-backend-module
NoYesAug 20, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management