CVE-2026-133765

MEDIUMCVSS 5.3/10EPSS 0.53%

Last modified

CVE-2026-133765 is a medium-severity vulnerability rated 5.3/10 on the CVSS scale. 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. EPSS estimates a 0.53% chance of exploitation in the next 30 days.

Description

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.

Metrics

Weakness Enumeration

Affected Software

Source: CNA advisory (CVE.org). NVD analysis pending.

VendorProductVersions
Twigtwig/twig>= 3.23.0, < 3.31.1

References

Timeline

Published
Last Modified
Status
Awaiting Analysis

Frequently Asked Questions

What is CVE-2026-133765?
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.
How severe is CVE-2026-133765?
CVE-2026-133765 has a CVSS score of 5.3/10 (MEDIUM severity). The EPSS model estimates a 0.53% probability of exploitation in the next 30 days.
How do I fix CVE-2026-133765?
Check the vendor references and advisories linked above for patched versions and mitigation guidance. You can also run a Strix scan to test if your systems are affected.

How Strix Helps

Related CVEs from 2026

Are you affected by CVE-2026-133765?

Run a free Strix scan to check your systems for this vulnerability.

Scan your code now

Source: NVD / NIST