CVE-2026-46636Twig: Sandbox method allowlist bypass via `Markup` subclass
Updated under an hour ago ()
Does this affect you?
It affects twigphp Twig. Add what you run to find out whether that includes you.
No exploitation reported and no EPSS estimate yet.
Do this next
Free account, 1 product
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.
- CVSS
- 8.7 HIGH (v4.0, CNA)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
- Weakness (CWE)
- CWE-1336
- Known exploited
- Not in CISA's KEV catalog
- EPSS (exploitation in the next 30 days)
- Not loaded for this CVE
- Assigned by
- GitHub_M
- NVD analysis
- Awaiting Analysis
- Record last updated
- Sep 8, 2026
- First seen by InfoSec Signals
- Oct 9, 2026
Affected products
twigphp Twig twigphp:twig (from the name) | from 1.0.0, < 3.27.0 | CNA record |
References
- https://github.com/twigphp/Twig/security/advisories/GHSA-64jr-qjx4-w2fhx-refsource-confirm
- https://security-tracker.debian.org/tracker/CVE-2026-46636x-refsource-misc
- https://security-tracker.debian.org/tracker/DSA-6311-1x-refsource-misc
- https://symfony.com/blog/cve-2026-46636-sandbox-filter-tag-and-function-allow-list-bypass-when-sandbox-state-changes-between-rendersx-refsource-misc
- http://github.com/twigphp/Twig/releases/tag/v3.27.0x-refsource-misc
The CVE record on cve.org NVD's entry
The CVE record is authoritative. Products marked “from the name” were identified from the CNA's free-text names, not a CPE, and are matched less certainly. This product uses the NVD API but is not endorsed or certified by the NVD.