{"id":"CVE-2026-48806","published":"2026-07-14T21:28:08Z","modified":"2026-07-15T12:47:14Z","title":"Twig: Sandbox `__toString()` policy bypass via dynamic mapping keys","vendor":"twigphp","product":"Twig","tier":"tail","description":{"text":"Twig is a template language for PHP. Prior to 3.27.0, ArrayExpression does not guard dynamic mapping keys that are coerced to strings, allowing PHP to invoke __toString() on a Stringable object used as a mapping key without calling SandboxExtension::ensureToStringAllowed(). This issue is fixed in version 3.27.0.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.1,"severity":"HIGH","version":"4.0","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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00418,"percentile":0.27791,"provenance":"source"},"cwes":[{"id":"CWE-693","name":"Protection Mechanism Failure"},{"id":"CWE-863","name":"Incorrect Authorization"}],"references":[{"url":"https://github.com/twigphp/Twig/security/advisories/GHSA-5v5v-ww74-355v","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/twigphp/Twig/commit/9ff41014639ef0e8eb50ac7669191c309d863105","tags":["x_refsource_MISC"]},{"url":"https://github.com/twigphp/Twig/releases/tag/v3.27.0","tags":["x_refsource_MISC"]}],"priority":{"score":10.5,"factors":[{"name":"EPSS percentile","points":5.56},{"name":"CVSS severity","points":4.97}]},"vendorSlug":"twigphp","affectedVersions":[{"vendor":"twigphp","product":"Twig","versions":["< 3.27.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-07-15T12:47:04.147602Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Packagist","package":"twig/twig","vulnerableRanges":["<3.27.0"],"patched":["3.27.0"],"from":["GHSA-5v5v-ww74-355v"],"provenance":"source"}],"summary":{"text":"Twig, the PHP template language, has a flaw in its ArrayExpression handling prior to version 3.27.0: dynamic mapping keys that are coerced to strings are not guarded, so the sandbox's __toString() check is skipped. An attacker with network access and low privileges (no user interaction required) can make PHP invoke __toString() on a Stringable object used as a mapping key inside a sandboxed template, bypassing the sandbox's string-conversion policy.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:49:06Z"},"euvd":{"id":"EUVD-2026-44513","exploited":false,"provenance":"source"}}