CVE-2026-46629
Twig: Unbounded formatter memoisation in twig/intl-extra keyed on template-controlled arguments
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
5.3
Twig: Unbounded formatter memoisation in twig/intl-extra keyed on template-controlled arguments
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.
- Record
CVE-2026-46629- CVSS 4.0
- 5.3 Medium
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 - Weakness
- CWE-770
- Updated
- 2026-11-02
EUVDEUVD-2026-44568
5.3
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.
- Record
EUVD-2026-44568- CVSS 4.0
- 5.3 Medium
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 - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-35wc-cvqg-78fp
2.7
twig/intl-extra: Unbounded formatter memoisation in keyed on template-controlled arguments
Description
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.
A 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.
Resolution
The formatter caches are now bounded in size (100 entries each) and evict on a FIFO basis.
Credits
Twig would like to thank Claude Mythos Preview (via Project Glasswing) for reporting the issue and providing the fix.
- Record
GHSA-35wc-cvqg-78fp- CVSS 4.0
- 2.7 Low
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 - Weakness
- CWE-770
- Updated
- 2026-11-02
NVD
5.3
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.
- Record
CVE-2026-46629- CVSS 4.0
- 5.3 Medium
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/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 - CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-770
- Updated
- 2026-11-02
OSV
5.3
Twig: Unbounded formatter memoisation in twig/intl-extra keyed on template-controlled arguments
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.
- Record
CVE-2026-46629- CVSS 4.0
- 5.3 Medium
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 - Weakness
- CWE-770
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2026-46629
6.5
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.
- Record
DEBIAN-CVE-2026-46629- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVGHSA-35wc-cvqg-78fp
2.7
twig/intl-extra: Unbounded formatter memoisation in keyed on template-controlled arguments
Description
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.
A 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.
Resolution
The formatter caches are now bounded in size (100 entries each) and evict on a FIFO basis.
Credits
Twig would like to thank Claude Mythos Preview (via Project Glasswing) for reporting the issue and providing the fix.
- Record
GHSA-35wc-cvqg-78fp- CVSS 4.0
- 2.7 Low
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 - Weakness
- CWE-770
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2026-46629
5.3
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.
- Record
UBUNTU-CVE-2026-46629- CVSS 4.0
- 5.3 Medium
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 - CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
twig/intl-extraPackagist |
before 3.26.0 | 3.26.0 |
php-twigDebian:12 |
before 3.5.1-1+deb12u3, plus listed versions 3.5.1-13.5.1-1+deb12u13.5.1-1+deb12u2 |
3.5.1-1+deb12u3 |
php-twigDebian:13 |
before 3.27.0-0+deb13u1, plus listed versions 3.20.0-23.21.1-13.21.1-23.21.1-33.22.0-1 Show 11 moreShow less3.22.0-23.22.1-13.22.1-23.22.1-33.22.2-13.22.2-23.23.0-13.23.0-23.24.0-13.26.0-0+deb13u13.26.0-1 |
3.27.0-0+deb13u1 |
php-twigDebian:14 |
before 3.26.0-1, plus listed versions 3.20.0-23.21.1-13.21.1-23.21.1-33.22.0-1 Show 9 moreShow less3.22.0-23.22.1-13.22.1-23.22.1-33.22.2-13.22.2-23.23.0-13.23.0-23.24.0-1 |
3.26.0-1 |
twig/intl-extraPackagist |
before 3.26.0, plus listed versions v2.12.0v2.12.1v2.12.2v2.12.3v2.12.4 Show 45 moreShow lessv2.12.5v2.13.0v2.13.1v2.14.0v2.14.1v2.14.2v2.14.3v2.14.7v2.14.8v2.14.9v2.15.0v2.15.2v2.15.4v2.15.5v2.15.6v2.16.0v3.0.0v3.0.0-BETA1v3.0.1v3.0.2v3.0.3v3.0.4v3.0.5v3.1.0v3.1.1v3.10.0v3.11.0v3.12.0v3.13.0v3.15.0v3.16.0v3.17.0v3.18.0v3.19.0v3.2.1v3.20.0v3.21.0v3.22.0v3.22.1v3.23.0v3.24.0v3.3.0v3.3.3v3.3.4v3.3.5 |
3.26.0 |
php-twigUbuntu:Pro:20.04:LTS |
All versions, plus listed versions 2.11.3-22.12.1-12.12.2-12.12.3-12.12.5-12.12.5-1ubuntu0.1~esm12.12.5-1ubuntu0.1~esm2 |
None known |
php-twigUbuntu:Pro:22.04:LTS |
All versions, plus listed versions 3.3.2-1ubuntu33.3.4-13.3.6-13.3.7-13.3.8-2ubuntu43.3.8-2ubuntu4+esm13.3.8-2ubuntu4+esm2 |
None known |
php-twigUbuntu:Pro:24.04:LTS |
All versions, plus listed versions 3.7.0-13.7.1-13.8.0-23.8.0-2ubuntu0.1~esm13.8.0-2ubuntu13.8.0-2ubuntu1+esm1 |
None known |
php-twigUbuntu:25.10 |
All versions, plus listed versions 3.20.0-2ubuntu1 |
None known |
php-twigUbuntu:26.10 |
All versions, plus listed versions 3.23.0-2build73.27.1-13.28.0-1 |
None known |
php-twigUbuntu:Pro:26.04:LTS |
All versions, plus listed versions 3.20.0-2ubuntu13.23.0-2build53.23.0-2build73.23.0-2ubuntu0.1~esm1 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-46629 is a medium vulnerability (CVSS 5.3) in Symfony Twig, published May 21, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.54%, the 45th percentile. Fixed in twig/intl-extra 3.26.0.
References
github.com/twigphp/Twig/security/advisories/GHSA-35wc-cvqg-78fp
github.com/twigphp/Twig/commit/6add9066fc5c0455eb764c1f3af6e4e4e3562419
github.com/twigphp/Twig/releases/tag/v3.26.0
github.com/FriendsOfPHP/security-advisories/blob/master/twig/intl-extra/CVE-2026-46629.yaml
symfony.com/cve-2026-46629
github.com/advisories/GHSA-35wc-cvqg-78fp
Show 7 moreShow less
github.com/CVEProject/cvelistV5/tree/main/cves/2026/46xxx/CVE-2026-46629.json
nvd.nist.gov/vuln/detail/CVE-2026-46629
security-tracker.debian.org/tracker/CVE-2026-46629
github.com/twigphp/Twig
ubuntu.com/security/CVE-2026-46629
cve.org/CVERecord?id=CVE-2026-46629
symfony.com/blog/cve-2026-46629-unbounded-formatter-memoisation-in-twig-intl-extra-keyed-on-template-controlled-arguments
Left out here: 10 versions. The JSON record has them.