Mend.io Vulnerability Database
The largest open source vulnerability database
What is a Vulnerability ID?
New vulnerability? Tell us about it!
CVE-2026-133765
Published:November 24, 2026
Updated:November 29, 2026
The sandbox checks that a template may call toString() on an object before converting it to a string. Since Twig 3.23.0, assignments like x = obj, and the destructuring forms [a] = list and {a} = obj, evaluate to the value that they assign. The sandbox didn't check that value, so a sandboxed template could call a denied toString() method: {{ (x = obj) }} {{ ({secret: s} = obj)|join }} No tag needs to be allowed. The sandbox now checks the result of assignments like the result of filters and functions. {% do x = obj %} and {% if (x = obj) %} still work, since they don't convert the value to a string.
Affected Packages
https://github.com/twigphp/Twig.git (GITHUB):
Affected version(s) =v4.0.0-alpha1 <v4.0.0-beta1
Fix Suggestion:
Update to version v4.0.0-beta1
https://github.com/twigphp/Twig.git (GITHUB):
Affected version(s) >=v3.23.0 <v3.31.1
Fix Suggestion:
Update to version v3.31.1
twig/twig (PHP):
Affected version(s) =v4.0.0-alpha1 <v4.0.0-beta1
Fix Suggestion:
Update to version v4.0.0-beta1
twig/twig (PHP):
Affected version(s) >=v3.23.0 <v3.31.1
Fix Suggestion:
Update to version v3.31.1
Do you need more information?
Contact Us
CVSS v4
Base Score:
5.3
Attack Vector
NETWORK
Attack Complexity
LOW
Attack Requirements
NONE
Privileges Required
LOW
User Interaction
NONE
Vulnerable System Confidentiality
LOW
Vulnerable System Integrity
NONE
Vulnerable System Availability
NONE
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
4.3
Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
LOW
Integrity
NONE
Availability
NONE
Weakness Type (CWE)
Protection Mechanism Failure
Incorrect Authorization
EPSS
Base Score:
0.53