{"id":"CVE-2026-46629","aliases":["CVE-2026-46629","GHSA-35wc-cvqg-78fp"],"related":[],"kind":"vulnerability","state":"published","title":"Twig: Unbounded formatter memoisation in twig/intl-extra keyed on template-controlled arguments","summary":"Twig is a template language for PHP. Prior to 3.26.0, twig/intl-extra memoises IntlDateFormatter and NumberFormatter instances in arrays keyed by template-controlled filter arguments such as locale, pattern, and attrs, allowing a template to allocate many ICU formatter objects that remain pinned for the lifetime of the Twig\\Environment. This issue is fixed in version 3.26.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Twig is a template language for PHP. Prior to 3.26.0, twig/intl-extra memoises IntlDateFormatter and NumberFormatter instances in arrays keyed by template-controlled filter arguments such as locale, pattern, and attrs, allowing a template to allocate many ICU formatter objects that remain pinned for the lifetime of the Twig\\Environment. This issue is fixed in version 3.26.0.","source":"cvelist"},{"lang":"en","text":"### Description\n\n`IntlExtension` memoises every `\\IntlDateFormatter` and `\\NumberFormatter` it creates in instance-level arrays keyed on a hash that includes `locale`, `pattern`, `attrs` and other values that are ordinary named arguments of the `format_datetime` / `format_date` / `format_time` / `format_number` / `format_currency` filters. There is no size limit and no eviction.\n\nA template that iterates over many distinct `pattern` (or `locale`, or `grouping_used`, ...) values therefore allocates one ICU formatter object per distinct value and pins it for the entire lifetime of the `Twig\\Environment`. Because ICU allocates its backing buffers outside the Zend memory manager, this growth is not bounded by `memory_limit`. On long-running runtimes (RoadRunner, Swoole, FrankenPHP worker mode, ReactPHP) where the `Environment` outlives a single request, the cache also accumulates across requests.\n\n### Resolution\n\nThe formatter caches are now bounded in size (100 entries each) and evict on a FIFO basis.\n\n### Credits\n\nTwig would like to thank Claude Mythos Preview (via Project Glasswing) for reporting the issue and providing the fix.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Twig es un lenguaje de plantillas para PHP. Antes de la versión 3.26.0, twig/intl-extra memoriza instancias de IntlDateFormatter y NumberFormatter en arrays indexados por argumentos de filtro controlados por la plantilla, como la configuración regional, el patrón y los atributos, permitiendo que una plantilla asigne muchos objetos formateadores ICU que permanecen anclados durante la vida útil del Twig\\Environment. Este problema está solucionado en la versión 3.26.0.","source":"nvd"}],"published":"2026-05-21T21:23:53.000Z","modified":"2026-10-24T22:10:00.210Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U","rating":"LOW"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-770"],"affected":[{"ranges":[{"version":"< 3.26.0","status":"affected"}],"vendor":"twigphp","product":"Twig","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.26.0"}],"ecosystem":"Packagist","package":"twig/intl-extra","purl":"pkg:composer/twig/intl-extra","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.26.0"}],"vendor":"symfony","product":"twig","cpe":"cpe:2.3:a:symfony:twig:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/twigphp/Twig/security/advisories/GHSA-35wc-cvqg-78fp","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/twigphp/Twig/commit/6add9066fc5c0455eb764c1f3af6e4e4e3562419","tags":["patch","x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/twigphp/Twig/releases/tag/v3.26.0","tags":["release-notes","x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/intl-extra/CVE-2026-46629.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/twigphp/Twig","tags":["package"],"sources":["ghsa"]},{"url":"https://symfony.com/cve-2026-46629","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-07-15T12:52:19.614Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-46629","url":"https://www.cve.org/CVERecord?id=CVE-2026-46629","licence":"CVE Terms of Use","modified":"2026-07-15T12:53:13.636Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-35wc-cvqg-78fp","url":"https://github.com/advisories/GHSA-35wc-cvqg-78fp","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:04.305Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-46629","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-46629","licence":"Public domain","modified":"2026-10-24T22:10:00.210Z"}],"updatedAt":"2026-11-25T22:59:28.236Z","epss":{"score":0.00542,"percentile":0.39149,"date":"2026-11-30T12:00:22.000Z"}}