Description
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.
Published: 2026-07-14
Score: 5.3 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Twig is a templating engine for PHP. A flaw in older releases before 3.26.0 lets the twig/intl-extra extension cache IntlDateFormatter and NumberFormatter objects in arrays keyed by arguments supplied by the template such as locale, pattern, and attributes. The keys come directly from template input, so an attacker can cause an unbounded number of formatter instances that persist for the lifetime of the Twig environment. The uncontrolled growth can exhaust heap memory, leading to a denial of service. This is an instance of resource exhaustion (CWE‑770).

Affected Systems

The vulnerability affects twigphp's Twig product. All releases older than 3.26.0 are susceptible; the issue is fixed in 3.26.0 and newer versions.

Risk and Exploitability

The flaw carries a CVSS score of 5.3, indicating medium severity, while the EPSS score of less than 1% signals a low historical exploitation probability. It is not listed in the CISA KEV catalog. Exploitation requires only the ability to supply a template or template arguments, no special privileges. Based on the description, the likely attack vector is an application that renders user‑controlled templates or passes user‑controlled values to the intl filters, which can trigger memory exhaustion and service interruption.

Generated by OpenCVE AI on July 31, 2026 at 04:35 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade to Twig 3.26.0 or later to remove the unbounded memoisation of formatter objects.
  • If an upgrade is not immediately possible, disable or remove the intl‑extra extension from the Twig environment to eliminate the vulnerable code paths.
  • If the intl filters must remain, restrict or sanitize the values of locale, pattern, and attributes passed from templates to limit the creation of many formatter instances.
  • Monitor memory usage of template rendering processes to detect abnormal consumption.

Generated by OpenCVE AI on July 31, 2026 at 04:35 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Debian DSA Debian DSA DSA-6311-1 php-twig security update
Debian DSA Debian DSA DSA-6320-1 php-twig security update
Github GHSA Github GHSA GHSA-35wc-cvqg-78fp twig/intl-extra: Unbounded formatter memoisation in keyed on template-controlled arguments
History

Wed, 15 Jul 2026 15:15:00 +0000

Type Values Removed Values Added
First Time appeared Twigphp
Twigphp twig
Vendors & Products Twigphp
Twigphp twig

Wed, 15 Jul 2026 13:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 14 Jul 2026 21:45:00 +0000

Type Values Removed Values Added
Description 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.
Title Twig: Unbounded formatter memoisation in twig/intl-extra keyed on template-controlled arguments
Weaknesses CWE-770
References
Metrics cvssV4_0

{'score': 5.3, '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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-15T12:53:13.636Z

Reserved: 2026-05-15T19:34:14.013Z

Link: CVE-2026-46629

cve-icon Vulnrichment

Updated: 2026-07-15T12:53:00.560Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-31T04:45:17Z

Weaknesses
  • CWE-770

    Allocation of Resources Without Limits or Throttling