PT-2026-42588 · Packagist · Twig/Intl-Extra
Published
2026-05-21
·
Updated
2026-05-21
CVSS v4.0
2.7
Low
| Vector | AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U |
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 TwigEnvironment. 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.
Exploit
Fix
Allocation of Resources Without Limits
Found an issue in the description? Have something to add? Feel free to write us 👾
Weakness Enumeration
Related Identifiers
Affected Products
Twig/Intl-Extra