GHSA-35wc-cvqg-78fp

Suggest an improvement
Source
https://github.com/advisories/GHSA-35wc-cvqg-78fp
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-35wc-cvqg-78fp/GHSA-35wc-cvqg-78fp.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-35wc-cvqg-78fp
Aliases
Published
2026-05-21T21:23:53Z
Modified
2026-09-10T03:51:04Z
Severity
  • 2.7 (Low) CVSS_V4 - 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 CVSS Calculator
Summary
twig/intl-extra: Unbounded formatter memoisation in keyed on template-controlled arguments
Details

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.

Database specific
{
    "cwe_ids": [
        "CWE-770"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-05-21T21:23:53Z",
    "nvd_published_at": null,
    "severity": "LOW"
}
References

Affected packages

Packagist / twig/intl-extra

Package

Name
twig/intl-extra
Purl
pkg:composer/twig/intl-extra

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
3.26.0

Affected versions

v2.*
v2.12.0
v2.12.1
v2.12.2
v2.12.3
v2.12.4
v2.12.5
v2.13.0
v2.13.1
v2.14.0
v2.14.1
v2.14.2
v2.14.3
v2.14.7
v2.14.8
v2.14.9
v2.15.0
v2.15.2
v2.15.4
v2.15.5
v2.15.6
v2.16.0
v3.*
v3.0.0-BETA1
v3.0.0
v3.0.1
v3.0.2
v3.0.3
v3.0.4
v3.0.5
v3.1.0
v3.1.1
v3.2.1
v3.3.0
v3.3.3
v3.3.4
v3.3.5
v3.4.0
v3.4.2
v3.5.0
v3.5.1
v3.6.0
v3.7.0
v3.7.1
v3.8.0
v3.9.0
v3.9.2
v3.10.0
v3.11.0
v3.12.0
v3.13.0
v3.15.0
v3.16.0
v3.17.0
v3.18.0
v3.19.0
v3.20.0
v3.21.0
v3.22.0
v3.22.1
v3.23.0
v3.24.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-35wc-cvqg-78fp/GHSA-35wc-cvqg-78fp.json"