{"id":"CVE-2026-55792","aliases":["CVE-2026-55792","GHSA-287w-mxq6-x2cp"],"related":[],"kind":"vulnerability","state":"published","title":"Craft CMS: Sensitive File Disclosure / Server-Side File Read","summary":"Craft CMS is a content management system (CMS). In versions starting from 4.0.0-RC1 and prior to 4.18.0, and 5.0.0-RC1 and above, prior to 5.10.0, the dataUrl() Twig function is included in Craft’s Twig sandbox allowlist, allowing any control panel user granted the utility:system-messages permission to embed a file-reading payload into system email templates. When those emails are sent, the server reads the target file and returns its contents as a base64-encoded data URL embedded in the email body. The .env file, which typically contains the database password, CRAFT_SECURITY_KEY, and third-party API keys, passes all of Craft’s existing dataUrl() protection checks and is fully exfiltrated. Obtaining CRAFT_SECURITY_KEY enables an attacker to forge session tokens and escalate to full admin account takeover. This issue has been fixed in versions 4.18.0 and 5.10.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Craft CMS is a content management system (CMS). In versions starting from 4.0.0-RC1 and prior to 4.18.0, and 5.0.0-RC1 and above, prior to 5.10.0, the dataUrl() Twig function is included in Craft’s Twig sandbox allowlist, allowing any control panel user granted the utility:system-messages permission to embed a file-reading payload into system email templates. When those emails are sent, the server reads the target file and returns its contents as a base64-encoded data URL embedded in the email body. The .env file, which typically contains the database password, CRAFT_SECURITY_KEY, and third-party API keys, passes all of Craft’s existing dataUrl() protection checks and is fully exfiltrated. Obtaining CRAFT_SECURITY_KEY enables an attacker to forge session tokens and escalate to full admin account takeover. This issue has been fixed in versions 4.18.0 and 5.10.0.","source":"cvelist"},{"lang":"en","text":"The `dataUrl()` Twig function is included in Craft’s Twig sandbox allowlist, allowing any control panel user granted the `utility:system-messages` permission to embed a file-reading payload into system email templates. When those emails are sent, the server reads the target file and returns its contents as a base64-encoded data URL embedded in the email body. The .env file, which typically contains the database password, CRAFT_SECURITY_KEY, and third-party API keys, passes all of Craft’s existing `dataUrl()` protection checks and is fully exfiltrated. Obtaining CRAFT_SECURITY_KEY enables an attacker to forge session tokens and escalate to full admin account takeover.\n\n## Details\nAffected versions: Craft CMS 4.x, 5.x (confirmed against 5.9.19)\n\nThe vulnerability arises from the combination of three code facts:\n1. dataUrl is in the Twig sandbox allowlist\nsrc/config/twig-sandbox.php, line 115:\nphp'allowedFunctions' => [\n    ...\n    'dataUrl',   // ← allows file reading inside sandboxed templates\n    ...\n],\n\n2. Html::dataUrl() does not block dotfiles\nsrc/helpers/Html.php, lines 1065–1090. The function applies four checks before reading a file:\n\nMust be within the project root .env is at the root\nMust not be in a system directory (config/, vendor/, storage/, templates/) .env is not\nMust not be a .php file  .env has no extension\nFile must exist .env always exists in a Craft install\n\nThere is no check for dotfiles or specifically for .env. All four checks pass silently and file_get_contents() is called, with the result returned as data:text/plain;base64,....\n\n3. System message body is rendered via renderSandboxedString()\nsrc/mail/Mailer.php, lines 181–183:\nphp$subject = $view->renderSandboxedString($systemMessage->subject, $variables);\n$textBody = $view->renderSandboxedString($systemMessage->body, $variables);\n$htmlBody = $view->renderSandboxedString($systemMessage->body, $variables, escapeHtml: true);\n\nAny body content saved to a system message is executed inside the Twig sandbox when the email renders. Because dataUrl is in allowedFunctions, the sandbox policy permits its execution without restriction.\n\nAccess control: The utility:system-messages permission is a non-admin CP permission grantable to any user group via Settings > Users > Groups. It is not restricted to admins.\n\n## Impact\nVulnerability type: Sensitive File Disclosure / Server-Side File Read\nWho is impacted: Any Craft CMS 4.x or 5.x installation where at least one non-admin control panel user has been granted the utility:system-messages permission, and email sending is configured.\n\nResources:\n\n- https://github.com/craftcms/cms/pull/18559","format":"markdown","source":"ghsa"},{"lang":"es","text":"Craft CMS es un sistema de gestión de contenido (CMS). En versiones a partir de 4.0.0-RC1 y anteriores a 4.18.0, y 5.0.0-RC1 y superiores, anteriores a 5.10.0, la función Twig dataUrl() está incluida en la lista de permitidos (allowlist) del sandbox de Twig de Craft, permitiendo a cualquier usuario del panel de control con el permiso utility:system-messages incrustar una carga útil (payload) de lectura de archivos en las plantillas de correo electrónico del sistema. Cuando se envían esos correos electrónicos, el servidor lee el archivo objetivo y devuelve su contenido como una URL de datos codificada en base64 incrustada en el cuerpo del correo electrónico. El archivo .env, que normalmente contiene la contraseña de la base de datos, CRAFT_SECURITY_KEY y claves API de terceros, pasa todas las comprobaciones de protección dataUrl() existentes de Craft y es completamente exfiltrado. La obtención de CRAFT_SECURITY_KEY permite a un atacante falsificar tokens de sesión y escalar a una toma de control completa de la cuenta de administrador. Este problema ha sido solucionado en las versiones 4.18.0 y 5.10.0.","source":"nvd"}],"published":"2026-07-01T23:20:28.993Z","modified":"2026-10-25T21:10:00.770Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":6,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":6,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","rating":"MEDIUM"}],"cwes":["CWE-200"],"affected":[{"ranges":[{"version":">= 4.0.0-RC1, < 4.18.0","status":"affected"},{"version":">= 5.0.0-RC1, < 5.10.0","status":"affected"}],"vendor":"craftcms","product":"cms","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"4.0.0-RC1","status":"affected","fixed":"4.18.0"}],"ecosystem":"Packagist","package":"craftcms/cms","purl":"pkg:composer/craftcms/cms","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"5.0.0-RC1","status":"affected","fixed":"5.10.0"}],"ecosystem":"Packagist","package":"craftcms/cms","purl":"pkg:composer/craftcms/cms","source":"ghsa"}],"references":[{"url":"https://github.com/craftcms/cms/security/advisories/GHSA-287w-mxq6-x2cp","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/craftcms/cms/pull/18559","tags":["exploit","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-55792","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/craftcms/cms","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-07-02T14:48:43.714Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-55792","url":"https://www.cve.org/CVERecord?id=CVE-2026-55792","licence":"CVE Terms of Use","modified":"2026-07-02T14:49:11.273Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-287w-mxq6-x2cp","url":"https://github.com/advisories/GHSA-287w-mxq6-x2cp","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:51.373Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-55792","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-55792","licence":"Public domain","modified":"2026-10-25T21:10:00.770Z"}],"updatedAt":"2026-11-25T22:59:26.986Z","epss":{"score":0.00333,"percentile":0.28537,"date":"2026-12-01T12:00:22.000Z"}}