CVE-2026-46636

Twig: Sandbox method allowlist bypass via `Markup` subclass

HIGH
8.7
CVSS Score
Published: September 4, 2026 at 10:07 PM UTC
Updated: September 25, 2026 at 02:37 PM UTC
1 product affected across 1 vendorTwig

Using Twig by twigphp?

Get instant alerts when new vulnerabilities affect Twig - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH8.7
Exploit prediction
EPSS 0.6%
SSVC
No known exploit

Description

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 3.27.0
Affected range stops below 3.27.0, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet, and no fixed version or vendor advisory is recorded against it.

SSVC — Action Prioritization

SSVCNo known exploitAutomatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

8.7HIGHGitHub_M
Vector?

Quick Info

StatusAWAITING ANALYSIS
CWE
CWE-1336

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card