{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2026-47732","id":"CVE-2026-47732","title":"Twig Sandbox: multiple `__toString()` policy bypasses via unguarded string coercion points","description":"Twig is a template language for PHP. Prior to 3.26.0, several Twig language constructs trigger PHP string coercion on a Stringable operand without consulting SecurityPolicy::checkMethodAllowed(), allowing a sandboxed template author to invoke __toString() on objects reachable in the render context through conditional expressions, comparison operators, tests, template-loading tags, dynamic attribut","descriptionLong":"Twig is a template language for PHP. Prior to 3.26.0, several Twig language constructs trigger PHP string coercion on a Stringable operand without consulting SecurityPolicy::checkMethodAllowed(), allowing a sandboxed template author to invoke __toString() on objects reachable in the render context through conditional expressions, comparison operators, tests, template-loading tags, dynamic attribute names, spread arguments, the do tag, and the .. range operator. This issue is fixed in version 3.26.0.","published":"2026-07-14T21:12:13.071Z","updated":"2026-10-28T02:30:31.715026339Z","reserved":"2026-05-19T22:16:39.503Z","status":"Analyzed","rejected":false,"assigner":"GitHub_M","metric":{"version":"4.0","score":7.1,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N","rating":"high","source":"GitHub_M"},"metrics":[{"version":"4.0","score":7.1,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N","rating":"high","source":"GitHub_M"},{"version":"4.0","score":7.1,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:L/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","rating":"high","source":"github.com"},{"version":"4.0","score":null,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N","rating":"unrated","source":"OSV"},{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","rating":"medium","source":"NVD"}],"rating":"high","products":["twigphp Twig"],"affectedProducts":[{"vendor":"twigphp","product":"Twig","defaultStatus":null,"versions":[{"version":"< 3.26.0","status":"affected"}],"platforms":[]}],"packages":[{"ecosystem":"Packagist","name":"twig/twig","purl":"pkg:composer/twig/twig","ranges":["<3.26.0"],"fixed":["3.26.0"],"advisory":"GHSA-pr2w-4gpj-cpq4"}],"cwes":["CWE-863","CWE-20"],"aliases":["GHSA-pr2w-4gpj-cpq4"],"references":[{"url":"https://github.com/twigphp/Twig/security/advisories/GHSA-pr2w-4gpj-cpq4","tags":["x_refsource_CONFIRM","Vendor Advisory","advisory","web"]},{"url":"https://github.com/twigphp/Twig/commit/447d0b2331e01b8fc6e08119ac984e1ef50caef9","tags":["x_refsource_MISC","Patch","fix"]},{"url":"https://github.com/twigphp/Twig/releases/tag/v3.26.0","tags":["x_refsource_MISC","Release Notes","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/47xxx/CVE-2026-47732.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47732","tags":["advisory"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-47732.yaml","tags":["web"]},{"url":"https://github.com/twigphp/Twig","tags":["package"]},{"url":"https://symfony.com/cve-2026-47732","tags":["web"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial"},"epss":0.00402,"epssPercentile":0.3505,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-47732","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47732","ok":true,"note":"Analyzed"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2026-47732","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-pr2w-4gpj-cpq4","ok":true,"note":"GHSA-pr2w-4gpj-cpq4"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-47732","ok":true,"note":"scored 2026-11-18"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}