{"api_version":"1","generated_at":"2026-11-24T13:50:10+00:00","cve":"CVE-2026-133765","urls":{"html":"https://cve.report/CVE-2026-133765","api":"https://cve.report/api/cve/CVE-2026-133765.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-133765","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-133765"},"summary":{"title":"Sandbox `__toString()` policy bypass via assignment and destructuring expressions","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:\n\n{{ (x = obj) }}\n{{ ({secret: s} = obj)|join }}\n\nNo tag needs to be allowed.\n\nThe 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.","state":"PUBLISHED","assigner":"Symfony","published_at":"2026-11-24 13:17:24","updated_at":"2026-11-24 13:17:24"},"problem_types":["CWE-693","CWE-863","CWE-693 CWE-693 Protection Mechanism Failure","CWE-863 CWE-863 Incorrect Authorization"],"metrics":[{"version":"4.0","source":"b5aa5c7f-767d-4597-9c64-3ac08b8711c6","type":"Secondary","score":"5.3","severity":"MEDIUM","vector":"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","data":{"version":"4.0","vectorString":"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","baseScore":5.3,"baseSeverity":"MEDIUM","attackVector":"NETWORK","attackComplexity":"LOW","attackRequirements":"NONE","privilegesRequired":"LOW","userInteraction":"NONE","vulnConfidentialityImpact":"LOW","vulnIntegrityImpact":"NONE","vulnAvailabilityImpact":"NONE","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","subAvailabilityImpact":"NONE","exploitMaturity":"NOT_DEFINED","confidentialityRequirement":"NOT_DEFINED","integrityRequirement":"NOT_DEFINED","availabilityRequirement":"NOT_DEFINED","modifiedAttackVector":"NOT_DEFINED","modifiedAttackComplexity":"NOT_DEFINED","modifiedAttackRequirements":"NOT_DEFINED","modifiedPrivilegesRequired":"NOT_DEFINED","modifiedUserInteraction":"NOT_DEFINED","modifiedVulnConfidentialityImpact":"NOT_DEFINED","modifiedVulnIntegrityImpact":"NOT_DEFINED","modifiedVulnAvailabilityImpact":"NOT_DEFINED","modifiedSubConfidentialityImpact":"NOT_DEFINED","modifiedSubIntegrityImpact":"NOT_DEFINED","modifiedSubAvailabilityImpact":"NOT_DEFINED","Safety":"NOT_DEFINED","Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","valueDensity":"NOT_DEFINED","vulnerabilityResponseEffort":"NOT_DEFINED","providerUrgency":"NOT_DEFINED"}},{"version":"4.0","source":"CNA","type":"CVSS","score":"5.3","severity":"MEDIUM","vector":"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","data":{"baseScore":5.3,"baseSeverity":"MEDIUM","vectorString":"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","version":"4.0"}}],"references":[{"url":"https://github.com/twigphp/Twig/commit/6bcdbc3d4470dde23e3e2636e7053e0512387edd","name":"https://github.com/twigphp/Twig/commit/6bcdbc3d4470dde23e3e2636e7053e0512387edd","refsource":"b5aa5c7f-767d-4597-9c64-3ac08b8711c6","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://symfony.com/cve-2026-133765","name":"https://symfony.com/cve-2026-133765","refsource":"b5aa5c7f-767d-4597-9c64-3ac08b8711c6","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://github.com/twigphp/Twig/security/advisories/GHSA-ccrc-gqhf-3cxc","name":"https://github.com/twigphp/Twig/security/advisories/GHSA-ccrc-gqhf-3cxc","refsource":"b5aa5c7f-767d-4597-9c64-3ac08b8711c6","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-133765","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-133765","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Twig","product":"twig/twig","version":"affected 3.23.0 3.31.1 semver","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[{"source":"CNA","value":"Fabien Potencier","lang":"en"},{"source":"CNA","value":"Jacko","lang":"en"},{"source":"CNA","value":"Inanna Malick","lang":"en"},{"source":"CNA","value":"Tudor-Andrei Oprea","lang":"en"}],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"collectionURL":"https://packagist.org","defaultStatus":"unaffected","packageName":"twig/twig","product":"twig/twig","repo":"https://github.com/twigphp/Twig","vendor":"Twig","versions":[{"lessThan":"3.31.1","status":"affected","version":"3.23.0","versionType":"semver"}]}],"credits":[{"lang":"en","type":"remediation developer","value":"Fabien Potencier"},{"lang":"en","type":"finder","value":"Jacko"},{"lang":"en","type":"finder","value":"Inanna Malick"},{"lang":"en","type":"finder","value":"Tudor-Andrei Oprea"}],"datePublic":"2026-11-24T12:58:32.000Z","descriptions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/markdown","value":"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:\n\n```twig\n{{ (x = obj) }}\n{{ ({secret: s} = obj)|join }}\n```\n\nNo tag needs to be allowed.\n\nThe 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."}],"value":"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:\n\n{{ (x = obj) }}\n{{ ({secret: s} = obj)|join }}\n\nNo tag needs to be allowed.\n\nThe 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":[{"cvssV4_0":{"baseScore":5.3,"baseSeverity":"MEDIUM","vectorString":"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","version":"4.0"},"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-693","description":"CWE-693 Protection Mechanism Failure","lang":"en","type":"CWE"}]},{"descriptions":[{"cweId":"CWE-863","description":"CWE-863 Incorrect Authorization","lang":"en","type":"CWE"}]}],"providerMetadata":{"dateUpdated":"2026-11-24T13:07:48.546Z","orgId":"b5aa5c7f-767d-4597-9c64-3ac08b8711c6","shortName":"Symfony"},"references":[{"name":"CVE-2026-133765","tags":["vendor-advisory"],"url":"https://symfony.com/cve-2026-133765"},{"name":"GHSA-ccrc-gqhf-3cxc","tags":["vendor-advisory"],"url":"https://github.com/twigphp/Twig/security/advisories/GHSA-ccrc-gqhf-3cxc"},{"tags":["patch"],"url":"https://github.com/twigphp/Twig/commit/6bcdbc3d4470dde23e3e2636e7053e0512387edd"}],"source":{"advisory":"GHSA-ccrc-gqhf-3cxc","discovery":"UNKNOWN"},"title":"Sandbox `__toString()` policy bypass via assignment and destructuring expressions","x_generator":{"engine":"symfony/ghsa-to-cve"}}},"cveMetadata":{"assignerOrgId":"b5aa5c7f-767d-4597-9c64-3ac08b8711c6","assignerShortName":"Symfony","cveId":"CVE-2026-133765","datePublished":"2026-11-24T13:07:48.546Z","dateReserved":"2026-11-20T14:01:43.158Z","dateUpdated":"2026-11-24T13:07:48.546Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-11-24 13:17:24","lastModifiedDate":"2026-11-24 13:17:24","problem_types":["CWE-693","CWE-863","CWE-693 CWE-693 Protection Mechanism Failure","CWE-863 CWE-863 Incorrect Authorization"],"metrics":{"cvssMetricV40":[{"source":"b5aa5c7f-767d-4597-9c64-3ac08b8711c6","type":"Secondary","cvssData":{"version":"4.0","vectorString":"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","baseScore":5.3,"baseSeverity":"MEDIUM","attackVector":"NETWORK","attackComplexity":"LOW","attackRequirements":"NONE","privilegesRequired":"LOW","userInteraction":"NONE","vulnConfidentialityImpact":"LOW","vulnIntegrityImpact":"NONE","vulnAvailabilityImpact":"NONE","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","subAvailabilityImpact":"NONE","exploitMaturity":"NOT_DEFINED","confidentialityRequirement":"NOT_DEFINED","integrityRequirement":"NOT_DEFINED","availabilityRequirement":"NOT_DEFINED","modifiedAttackVector":"NOT_DEFINED","modifiedAttackComplexity":"NOT_DEFINED","modifiedAttackRequirements":"NOT_DEFINED","modifiedPrivilegesRequired":"NOT_DEFINED","modifiedUserInteraction":"NOT_DEFINED","modifiedVulnConfidentialityImpact":"NOT_DEFINED","modifiedVulnIntegrityImpact":"NOT_DEFINED","modifiedVulnAvailabilityImpact":"NOT_DEFINED","modifiedSubConfidentialityImpact":"NOT_DEFINED","modifiedSubIntegrityImpact":"NOT_DEFINED","modifiedSubAvailabilityImpact":"NOT_DEFINED","Safety":"NOT_DEFINED","Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","valueDensity":"NOT_DEFINED","vulnerabilityResponseEffort":"NOT_DEFINED","providerUrgency":"NOT_DEFINED"}}]},"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"133765","Ordinal":"1","Title":"Sandbox `__toString()` policy bypass via assignment and destruct","CVE":"CVE-2026-133765","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"133765","Ordinal":"1","NoteData":"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:\n\n{{ (x = obj) }}\n{{ ({secret: s} = obj)|join }}\n\nNo tag needs to be allowed.\n\nThe 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.","Type":"Description","Title":"Sandbox `__toString()` policy bypass via assignment and destruct"}]}}}