{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-133766","assignerOrgId":"b5aa5c7f-767d-4597-9c64-3ac08b8711c6","state":"PUBLISHED","assignerShortName":"Symfony","dateReserved":"2026-11-20T14:01:43.158Z","datePublished":"2026-11-24T13:07:49.491Z","dateUpdated":"2026-11-24T13:07:49.491Z"},"containers":{"cna":{"providerMetadata":{"orgId":"b5aa5c7f-767d-4597-9c64-3ac08b8711c6","shortName":"Symfony","dateUpdated":"2026-11-24T13:07:49.491Z"},"title":"Sandbox `__toString()` policy bypass via spread arguments","datePublic":"2026-11-24T12:58:35.000Z","descriptions":[{"lang":"en","value":"Since Twig 3.28.0, the sandbox skips the toString() check of an argument whose PHP parameter can't hold a string, like an int. A spread argument was mapped to a single parameter, although it fills every parameter from its position on. A sandboxed template could therefore call a denied toString() method:\n\n{{ tag(...[1, obj]) }}\n\nHere, the first parameter of tag() is an int, and a later one accepts strings. Applications are affected when they allow such a function, filter or test in the sandbox. No built-in callable is affected.\n\nA spread argument is now checked unless every parameter that it can fill has a safe type.","supportingMedia":[{"type":"text/markdown","base64":false,"value":"Since Twig 3.28.0, the sandbox skips the `__toString()` check of an argument whose PHP parameter can't hold a string, like an `int`. A spread argument was mapped to a single parameter, although it fills every parameter from its position on. A sandboxed template could therefore call a denied `__toString()` method:\n\n```twig\n{{ tag(...[1, obj]) }}\n```\n\nHere, the first parameter of `tag()` is an `int`, and a later one accepts strings. Applications are affected when they allow such a function, filter or test in the sandbox. No built-in callable is affected.\n\nA spread argument is now checked unless every parameter that it can fill has a safe type."}]}],"affected":[{"vendor":"Twig","product":"twig/twig","collectionURL":"https://packagist.org","packageName":"twig/twig","repo":"https://github.com/twigphp/Twig","defaultStatus":"unaffected","versions":[{"version":"3.28.0","status":"affected","lessThan":"3.31.1","versionType":"semver"}]}],"problemTypes":[{"descriptions":[{"lang":"en","cweId":"CWE-693","description":"CWE-693 Protection Mechanism Failure","type":"CWE"}]},{"descriptions":[{"lang":"en","cweId":"CWE-863","description":"CWE-863 Incorrect Authorization","type":"CWE"}]}],"metrics":[{"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}],"cvssV4_0":{"version":"4.0","vectorString":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N","baseScore":2.3,"baseSeverity":"LOW"}}],"references":[{"url":"https://symfony.com/cve-2026-133766","name":"CVE-2026-133766","tags":["vendor-advisory"]},{"url":"https://github.com/twigphp/Twig/security/advisories/GHSA-56wp-8m9q-4354","name":"GHSA-56wp-8m9q-4354","tags":["vendor-advisory"]},{"url":"https://github.com/twigphp/Twig/commit/7af821c372f52cc9447afeba9e042de44b738222","tags":["patch"]}],"credits":[{"lang":"en","value":"Jacko","type":"finder"},{"lang":"en","value":"Nicolas Grekas","type":"remediation developer"}],"source":{"advisory":"GHSA-56wp-8m9q-4354","discovery":"UNKNOWN"},"x_generator":{"engine":"symfony/ghsa-to-cve"}}}}