CVE Catalog

CVE-2026-46636

HighCVSS 8.7
Published: Updated: Translated: NVD NIST

Exploitation Probability (EPSS)

Low risk
0.36%

29th percentile - higher than 29% of all known CVEs

Summary

Twig from version 1.0.0 to before 3.27.0 has a vulnerability in SecurityPolicy::checkMethodAllowed() that unconditionally whitelists all method calls on instances of Twig\Markup. Since Twig\Markup is not final, subclasses inherit the bypass. An application passing an object of a Markup-derived class into a sandboxed template inadvertently exposes every public method of that subclass to template authors. Patched in 3.27.0.

Risk Assessment

Template authors can invoke any public method of Markup-derived objects, potentially leading to unauthorized data access or execution of dangerous operations. This can compromise application confidentiality and integrity.

Recommendation

Upgrade Twig to version 3.27.0 or later to restrict default permissions for Twig\Markup.

Other vulnerabilities in Twig

See all
Original NVD description (English source)

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.

Vulnerability data from NVD (NIST) · CISA KEV · EPSS