CVE-2026-133764
Published:November 24, 2026
Updated:November 28, 2026
The sandbox checks that a template may call toString() on an object before converting it to a string. It didn't check the input of tests. The PHP callable of a test may convert this input to a string, for example when its parameter is typed as string. PHP then calls toString() on an object without the sandbox checking it first:
{{ obj is upperish }}
Applications are affected when they register such a test and allow it in the sandbox. No built-in test is affected.
The sandbox now checks the input of tests like the input of filters. The built-in tests that never convert their input to a string still skip the check.
Affected Packages
https://github.com/twigphp/Twig.git (GITHUB):
Affected version(s) >=v0.9.9 <v3.31.1 || >=v1.0.0-RC1 <v3.31.1 || >=v2.0.0 <v3.31.1 || >=v3.0.0-BETA1 <v3.31.1Fix Suggestion:
Update to version v3.31.1https://github.com/twigphp/Twig.git (GITHUB):
Affected version(s) =v4.0.0-alpha1 <v4.0.0-beta1Fix Suggestion:
Update to version v4.0.0-beta1twig/twig (PHP):
Affected version(s) =v4.0.0-alpha1 <v4.0.0-beta1Fix Suggestion:
Update to version v4.0.0-beta1twig/twig (PHP):
Affected version(s) >=v1.0.0-RC1 <v3.31.1 || >=v3.0.0-BETA1 <v3.31.1 || >=v0.9.9 <v3.31.1 || >=v2.0.0 <v3.31.1Fix Suggestion:
Update to version v3.31.1Related Resources (7)
Do you need more information?
Contact UsCVSS v4
Base Score:
2.3
Attack Vector
NETWORK
Attack Complexity
LOW
Attack Requirements
PRESENT
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
EPSS
Base Score:
0.53