{"id":"CVE-2026-46636","published":"2026-09-04T22:07:35Z","modified":"2026-09-08T17:38:45Z","title":"Twig: Sandbox method allowlist bypass via `Markup` subclass","vendor":"twigphp","product":"Twig","tier":"tail","description":{"text":"Twig is a template language for PHP. From version 1.0.0 to before version 3.27.0, SecurityPolicy::checkMethodAllowed() unconditionally whitelists all method calls on instances of Twig\\Markup. Twig\\Markup is not final, so subclasses inherit the bypass. An application that passes an object of a Markup-derived class into a sandboxed template (typically to mark a chunk of HTML as safe) inadvertently exposes every public method of that subclass to template authors, regardless of the configured allowedMethods list. This issue has been patched in version 3.27.0.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.7,"severity":"HIGH","version":"4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0057,"percentile":0.48087,"provenance":"source"},"cwes":[{"id":"CWE-1336","name":"Improper Neutralization of Special Elements Used in a Template Engine"}],"references":[{"url":"https://github.com/twigphp/Twig/security/advisories/GHSA-64jr-qjx4-w2fh","tags":["x_refsource_CONFIRM"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-46636","tags":["x_refsource_MISC"]},{"url":"https://security-tracker.debian.org/tracker/DSA-6311-1","tags":["x_refsource_MISC"]},{"url":"https://symfony.com/blog/cve-2026-46636-sandbox-filter-tag-and-function-allow-list-bypass-when-sandbox-state-changes-between-renders","tags":["x_refsource_MISC"]},{"url":"http://github.com/twigphp/Twig/releases/tag/v3.27.0","tags":["x_refsource_MISC"]}],"priority":{"score":15.7,"factors":[{"name":"EPSS percentile","points":9.62},{"name":"CVSS severity","points":6.09}]},"vendorSlug":"twigphp","affectedVersions":[{"vendor":"twigphp","product":"Twig","versions":[">= 1.0.0, < 3.27.0"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial","timestamp":"2026-09-08T17:37:04.193009Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2026-71779","exploited":false,"provenance":"source"}}