CVE-2026-46629: twig/intl-extra Unbounded Formatter Memoisation Vulnerability

LOW
Advisory Identifier: GHSA-35wc-cvqg-78fp
CWE-770
Published
Advisory Summary

CVE-2026-46629 is a LOW unbounded formatter memoisation vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting twig/intl-extra libraries in the Packagist ecosystem. The issue involves unbounded formatter memoisation in keyed on template-controlled arguments. Remediation is available by upgrading affected packages to version 3.26.0.

CVE-2026-46629 at a Glance

CVE Identifier CVE-2026-46629
GHSA Identifier GHSA-35wc-cvqg-78fp
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
Affected Product twig/intl-extra
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-46629

To remediate this vulnerability, upgrade all affected twig/intl-extra dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

twig/intl-extra fixed: 3.26.0
Upgrade twig/intl-extra to 3.26.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for twig/intl-extra

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-46629, inspect your project dependencies for twig/intl-extra:

inspect dependencies for twig/intl-extra

Analyze the terminal output to locate any version of twig/intl-extra in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.26.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In twig/intl-extra, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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.

CVE-2026-46629 Affected twig/intl-extra Versions

1 component(s)
Fixed Versions:
3.26.0
Product / Package Ecosystem Affected Versions Fixed Version
twig/intl-extra
Packagist
< 3.26.0
3.26.0

References

Frequently Asked Questions

What is CVE-2026-46629?
CVE-2026-46629 is a security vulnerability in twig/intl-extra involving Unbounded formatter memoisation in keyed on template-controlled arguments under CWE-770: Allocation of Resources Without Limits or Throttling.
Which twig/intl-extra versions are affected?
Affected versions include releases prior to 3.26.0 across affected packages: twig/intl-extra.
What version fixes CVE-2026-46629?
Upgrading to 3.26.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is twig/intl-extra affected?
Yes, twig/intl-extra is affected in releases prior to 3.26.0. Upgrade your dependency to 3.26.0 or later.
What CWE is associated with CVE-2026-46629?
CVE-2026-46629 is classified under CWE-770: Allocation of Resources Without Limits or Throttling (The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.).
How can I check Packagist dependencies for CVE-2026-46629?
Run the dependency tree command: 'inspect dependencies for twig/intl-extra'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-35wc-cvqg-78fp",
  "modified" : "2026-05-21T21:23:53Z",
  "published" : "2026-05-21T21:23:53Z",
  "aliases" : [ "CVE-2026-46629" ],
  "summary" : "twig/intl-extra: Unbounded formatter memoisation in keyed on template-controlled arguments",
  "details" : "### 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.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "twig/intl-extra"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.26.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/twigphp/Twig/security/advisories/GHSA-35wc-cvqg-78fp"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/intl-extra/CVE-2026-46629.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/twigphp/Twig"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/cve-2026-46629"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-21T21:23:53Z",
    "nvd_published_at" : null
  }
}