twig/intl-extra CVE-2026-46629
MEDIUMAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconIdentify persistent PHP worker deployment using twig/intl-extra < 3.26.0
-
DeliveryLocate endpoint that renders Twig template with user-influenced locale/pattern filter arguments
-
ExploitSend high volume of requests cycling through many distinct argument values
-
InstallIntlExtension allocates unbounded ICU formatter objects per unique value
-
C2ICU heap grows outside PHP memory_limit accounting
-
ExecuteWorker process RSS exhausted
-
ImpactDenial of service via OOM or severe degradation
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource allocation limits
MITRE ATT&CK
1 technique across 1 tactic: Impact The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation at meaningful scale requires three concurrent conditions: (1) twig/intl-extra prior to version 3.26.0 is installed; (2) the application runs on a persistent PHP worker runtime (RoadRunner, Swoole, FrankenPHP worker mode, or ReactPHP) where a single Twig\Environment instance is shared across multiple HTTP requests - this is the critical amplifier that allows cross-request cache accumulation; and (3) at least one Twig template invokes format_datetime, format_date, format_time, format_number, or format_currency with values that vary across requests (whether attacker-controlled or from legitimate high-cardinality data). On standard PHP-FPM or Apache mod_php deployments where a new process handles each request, cache state is discarded after every request and the vulnerability degrades to a within-request memory pressure concern only, substantially limiting impact. Authentication requirements cannot be confirmed from available data since no CVSS vector was provided; exploitation depends entirely on the application's exposure of the affected template rendering path. |
| Impact | No CVSS score or vector is available for CVE-2026-46629, which prevents quantitative scoring of attack vector, complexity, privileges required, or scope. The vulnerability is tagged as Denial of Service and classified CWE-770. No CISA KEV listing exists and no public exploit code has been identified at time of analysis. Real-world risk is highly deployment-dependent: applications running on persistent PHP workers (RoadRunner, Swoole, FrankenPHP, ReactPHP) where the Twig\Environment outlives a single request are at materially elevated risk, particularly if user-supplied values flow into locale, pattern, or other formatter-keyed filter arguments. Standard PHP-FPM and CGI deployments reset the process per request, severely limiting impact to within-request pressure only. If template arguments are attacker-controlled, exploitation requires no special skill and could be automated at scale. The absence of CVSS data means authentication requirements and attack complexity cannot be confirmed from available data - risk teams should assess based on their specific runtime and template data flow. |
| Exploit ScenarioDerived | An attacker targets an application running twig/intl-extra on a Swoole or RoadRunner worker and identifies that a template passes a request parameter (e.g., a locale preference or date format pattern) directly to format_datetime or format_number. By sending a high volume of requests each with a distinct locale string or pattern value, the attacker causes IntlExtension to allocate a new ICU formatter object for each unique value, pinning it indefinitely in the Twig\Environment's cache across all requests on that worker. Because ICU's backing buffers live outside PHP's memory_limit accounting, the OS-level process RSS grows without triggering PHP's memory protection, eventually causing OOM termination or severe performance degradation. No public exploit code has been identified at time of analysis, but the attack requires no specialized tooling beyond the ability to send HTTP requests with varied parameter values. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 21, 2026
Unbounded formatter memoization in twig/intl-extra versions prior to 3.26.0 enables memory exhaustion denial of service on persistent PHP worker runtimes. The IntlExtension caches every unique combination of template filter arguments (locale, pattern, grouping_used, attrs, etc.) as ICU formatter objects with no eviction policy; because ICU allocates its backing buffers outside the Zend memory manager, this growth entirely bypasses PHP's memory_limit directive. On long-running runtimes such as RoadRunner, Swoole, FrankenPHP worker mode, and ReactPHP - where a single Twig\Environment persists across requests - the cache accumulates indefinitely across all requests, making targeted or incidental denial of service achievable without any authentication. No public exploit has been identified at time of analysis and no CISA KEV listing exists.
RemediationAI
Upgrade twig/intl-extra to version 3.26.0 or later, which is the vendor-released patch confirmed in GHSA-35wc-cvqg-78fp. The fix introduces bounded FIFO caches capped at 100 entries each for both IntlDateFormatter and NumberFormatter objects, preventing unbounded heap growth. Execute composer require 'twig/intl-extra:^3.26.0' and redeploy. If an immediate upgrade is not possible, the most actionable compensating control is to audit and restrict whether user-supplied input can flow into the locale, pattern, grouping_used, or attrs arguments of Twig intl filters - eliminating attacker-controlled cache key diversity dramatically limits the practical impact, though it does not fix the underlying unbounded allocation. A secondary mitigation for persistent worker deployments is to configure scheduled worker restarts (e.g., RoadRunner's max_jobs setting to restart workers after N requests), which reclaims accumulated memory but introduces brief request interruption and does not prevent re-accumulation during each worker lifetime. See vendor advisory at https://github.com/twigphp/Twig/security/advisories/GHSA-35wc-cvqg-78fp.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in composer
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
twig/intl-extra is a Composer package (pkg:composer/twig/intl-extra) that provides Twig template filters for PHP internationalization: format_datetime, format_date, format_time, format_number, and format_currency. Internally, IntlExtension constructs PHP \IntlDateFormatter and \NumberFormatter objects (wrappers around the ICU library) and memoizes them in instance-level arrays keyed by a hash of the filter arguments. The root cause is CWE-770 (Allocation of Resources Without Limits or Throttling): the cache has no maximum size and no eviction mechanism. The critical amplifying factor is that ICU (International Components for Unicode) allocates its internal buffers on the native heap via the Zend extension mechanism, completely outside the Zend memory manager's accounting. This means PHP's memory_limit INI directive does not constrain the growth - the process's OS-level RSS can grow without bound while PHP reports no memory limit violation. The vulnerability is exclusively architectural; there is no memory corruption or logic flaw in the ICU library itself.
Know when the next one hits your stack
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Primary rating from Vendor (https://github.com/twigphp/Twig) · only source for this CVE.
CVSS VectorVendor: https://github.com/twigphp/Twig
Lifecycle Timeline
1DescriptionCVE.org
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.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
GHSA-35wc-cvqg-78fp
NVD
CVE.org
EPSS
Exploit-DB