PatchSiren cyber security CVE debrief
CVE-2026-133765 Twig CVE debrief
A sandbox bypass vulnerability was found in Twig, a templating engine for PHP. The vulnerability occurs when using assignment and destructuring expressions in a sandboxed template, allowing a template to call a denied __toString() method. This issue can be exploited by an attacker to bypass the sandbox and execute arbitrary code. Defenders should assess exposure and prioritize patching or mitigation. The vulnerability was addressed in Twig version 3.31.1. Affected applications using Twig 3.23.0 or later but less than 3.31.1 should be updated or mitigated.
- Vendor
- Twig
- Product
- twig/twig
- CVSS
- MEDIUM 5.3
- CISA KEV
- Not listed in stored evidence
- Original CVE published
- 2026-11-24
- Original CVE updated
- 2026-11-24
- Advisory published
- 2026-11-24
- Advisory updated
- 2026-11-24
Who should care
Defenders responsible for applications using Twig should assess exposure and prioritize patching or mitigation. Defenders need to verify if their applications use vulnerable versions of Twig and apply patches or mitigations as needed to prevent potential code execution. Successful exploitation could allow an attacker to bypass the sandbox and execute arbitrary code. Defenders should prioritize patching or mitigation to prevent potential code execution.
Why it matters
A sandbox bypass vulnerability was found in Twig, a templating engine for PHP. Defenders should prioritize verifying if their applications use vulnerable versions of Twig and apply patches or mitigations as needed to prevent potential code execution.
- Defenders need to verify if their applications use vulnerable versions of Twig.
- Successful exploitation could allow an attacker to bypass the sandbox and execute arbitrary code.
- Defenders should prioritize patching or mitigation to prevent potential code execution.
- Further verification is required to determine the full scope of affected systems and potential impact.
Technical summary
The vulnerability occurs when using assignment and destructuring expressions in a sandboxed template, allowing a template to call a denied __toString() method. This can be exploited by an attacker to bypass the sandbox and execute arbitrary code. The vulnerability was addressed in Twig version 3.31.1. Affected applications using Twig 3.23.0 or later but less than 3.31.1 should be updated or mitigated. The vulnerability was reported by a researcher and addressed by the vendor. Defenders should assess exposure and prioritize patching or mitigation.
Defensive priority
Defenders should prioritize verifying if their applications use vulnerable versions of Twig and apply patches or mitigations as needed.
Recommended defensive actions
- Verify if your application uses a vulnerable version of Twig (3.23.0 or later, but less than 3.31.1).
- Apply patches or mitigations as needed.
- Monitor your application for suspicious activity.
- Review compensating controls for exposed systems while remediation is scheduled and verified.
- Check relevant monitoring, detection, and logs for exposed assets that need extra review.
- Track exceptions, retest remediated assets, and close the item only after evidence is documented.
- Confirm whether affected product deployments exist in managed environments and assign an owner for follow-up.
Evidence notes
The CVE record and source item provide details on the vulnerability, including its description, affected versions, and references to vendor advisories and patches. The vulnerability was reported by a researcher and addressed by the vendor. The CVE record and source item provide evidence of the vulnerability and its impact. Defenders should verify if their applications use vulnerable versions of Twig and apply patches or mitigations as needed. The vendor has provided guidance on how to mitigate the vulnerability.
Sources and references
Verified primary and authoritative sources
-
CVE-2026-133765 CVE Program record
Publisher, destination, and source semantics verified
URL: https://www.cve.org/CVERecord?id=CVE-2026-133765
CVE Program - Official CVE Program record with source-provided CVE metadata.
-
CVE-2026-133765 NVD vulnerability detail
Publisher, destination, and source semantics verified
URL: https://nvd.nist.gov/vuln/detail/CVE-2026-133765
NIST National Vulnerability Database - Official NIST NVD detail page and source-specific vulnerability assessment.
Supplemental references
-
Sandbox `__toString()` policy bypass via assignment and destructuring expressions
Unverified legacy reference
URL: https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves/2026/133xxx/CVE-2026-133765.json
cve_program_cvelist_v5
-
Source reference
Unverified legacy reference
URL: https://symfony.com/cve-2026-133765
Supplemental source - vendor-advisory
-
Source reference
Unverified legacy reference
URL: https://github.com/twigphp/Twig/security/advisories/GHSA-ccrc-gqhf-3cxc
Supplemental source - vendor-advisory
-
Source reference
Unverified legacy reference
URL: https://github.com/twigphp/Twig/commit/6bcdbc3d4470dde23e3e2636e7053e0512387edd
Supplemental source - patch
Methodology and review provenance
AI-assisted synthesis based on stored public vulnerability evidence. System validation, approval state, and publication status do not by themselves establish human review of this revision. PatchSiren helps prioritize defensive review and does not prove exposure or remediation on any system.