Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessGain ability to author sandboxed Twig template
-
DeliveryInsert {{ obj is true }} test on target object
-
ExploitTest result evaluates to object, unchecked by sandbox
-
ExecutionString coercion invokes denied __toString()
-
ImpactDisclose object string representation
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V15 - Secure Coding and Architecture Protection mechanism completeness
|
| Exploitation Conditions | Exploitation requires that the application runs Twig with the sandbox enabled AND permits an attacker to supply or author the sandboxed template content; the attacker then uses the |
| Impact | This is a sandbox-escape information-disclosure flaw in Twig, best treated as a moderate, targeted-context issue rather than a broad emergency. The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:L/UI:N/VC:L, score 5.3) and the GHSA CWE pairing (CWE-693 Protection Mechanism Failure, CWE-863 Incorrect Authorization) agree on the shape: low attack complexity, no user interaction, but PR:L - the attacker must already be able to supply or author template content that runs inside the Twig sandbox, and the only confirmed impact is limited confidentiality (reading an object's string form). There is no KEV listing and no EPSS score in the input, so there is no signal of active or widespread exploitation; the vuln.today decision label is 'this_month', consistent with a real-but-not-critical fix priority. The vendor (Symfony/Twig) advisory publicly demonstrates the trigger template |
| Exploit ScenarioDerived | An application lets semi-trusted users author Twig templates under the sandbox (e.g. a CMS theme or email-template editor), relying on the sandbox to block disallowed object methods. An attacker who can submit a template writes |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 24, 2026
A sandbox policy bypass in the Twig template engine (versions 3.21.0 through 3.30.x, fixed in 3.31.1) lets a template author convert a sandbox-denied object to a string and read its __toString() output. When a sandboxed template evaluates {{ obj is true }} - or the same test result concatenated or passed to a filter - the interpreter coerces the object to a string without the sandbox's method-allowlist check, so only template-authoring capability inside the sandbox is needed and no Twig tag has to be allowed. Impact is limited to information disclosure of an object's string representation; a test used purely in a boolean context such as {% if obj is true %} does not trigger it. No public exploit code was identified at time of analysis, the issue is not in CISA KEV, and the vendor has released a patch.
RemediationAI
Upgrade twig/twig to 3.31.1 for the 3.x branch, which contains the vendor-released patch; the corresponding upstream commit is a41bd2dd466d771cc384b9730be6190eb5a4f4d0 (https://github.com/twigphp/Twig/commit/a41bd2dd466d771cc384b9730be6190eb5a4f4d0) and the advisories are at https://github.com/twigphp/Twig/security/advisories/GHSA-567w-cx2v-jc85 and https://symfony.com/cve-2026-133763. If the upgrade cannot be applied immediately, the exposure is bounded by who can author templates: applications that do not expose the sandbox to untrusted template authors are not realistically exploitable, so the practical interim control is to keep sandboxed template input restricted to trusted authors and review template sources for is true expressions whose result is printed, concatenated into a string, or passed to a filter (boolean-context uses such as {% if obj is true %} are not affected and need no change). Until patched, avoid passing objects with sensitive __toString() output into sandboxed templates authored by lower-trust users.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Twig's sandbox extension is implemented as a compiler pass (SandboxNodeVisitor) that rewrites the AST so that dynamic method calls, filters and functions are wrapped in runtime security checks before execution; among other things it verifies that a template is permitted to invoke __toString() on an object before that object is coerced to a string for output. The wrapping condition in the visitor covered FilterExpression and FunctionExpression nodes but omitted TestExpression nodes. Twig's true test returns its input unchanged for objects rather than a boolean, so the expression {{ obj is true }} produced the raw object as the print node's operand; the implicit string conversion during rendering therefore happened outside the sandbox check, exposing the result of a __toString() method the policy had denied. The same gap applied when the test result was concatenated ({{ (obj is true) ~ "" }}) or fed into a filter ({{ (obj is true)|upper }}), while a boolean-context use ({% if obj is true %} or a ternary condition) does not coerce and is unaffected. The upstream fix adds TestExpression to the node types that wrapNode() guards, so test results are now checked like filter and function results, and regression tests cover direct output, concatenation, filter input and the unaffected boolean context. The root causes map to CWE-693 (protection mechanism failure) and CWE-863 (incorrect authorization), and the exposed asset is whatever object state appears in an object's string representation.
Know when Twig gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
Attacker must supply sandboxed template content so PR:L; low complexity and no interaction; impact limited to disclosing an object's string form so C:L, I:N, A:N, scope unchanged.
Primary rating from Vendor (Symfony).
CVSS VectorVendor: Symfony
DescriptionCVE.org
The sandbox checks that a template may call toString() on an object before converting it to a string. For an object, the is true test evaluates to the object itself, and that result wasn't checked. A sandboxed template could therefore print an object through a denied toString() method:
{{ obj is true }}
The same applies when the result is concatenated or passed to a filter. No tag needs to be allowed. A test in a boolean context, like {% if obj is true %}, isn't affected, since it doesn't convert the object to a string.
The sandbox now checks the result of tests like the result of filters and functions.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Twig before 2.4.4 allows Server-Side Template Injection (SSTI) via the search search_key parameter. Rated critical sever
Sandbox bypass in Twig template engine versions 2.16.x and 3.9.0 through 3.25.x allows attackers with template rendering
Twig is a template language for PHP. Rated high severity (CVSS 8.6), this vulnerability is remotely exploitable, no auth
Twig is a template language for PHP. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no auth
The displayBlock function Template.php in Sensio Labs Twig before 1.20.0, when Sandbox mode is enabled, allows remote at
Denial-of-service via resource exhaustion affects the Twig templating engine for PHP prior to 3.26.0, where the sandbox
Symfony is a PHP framework for web and console applications and a set of reusable PHP components. Rated medium severity
Sandboxed Twig templates that are permitted to use the `join` filter can disclose the private and protected properties o
Twig's security sandbox allow-list can be bypassed by a sandboxed template that uses the `embed` tag with a parent expre
Sandbox policy bypass in Twig 3.23.0 through 3.31.0 lets whoever supplies the template source force the engine to invoke
A sandbox information disclosure exists in Twig before 1.38.0 and 2.x before 2.7.0 because, under some circumstances, it
Twig's autoescaping logic can print attacker-controlled values without HTML escaping when a template contains a macro im
EUVD-2026-133912
NVD
CVE.org
EPSS
GitHub
VulDB
Exploit-DB