Skip to main content

twig/intl-extra CVE-2026-46629

MEDIUM
Allocation of Resources Without Limits or Throttling (CWE-770)
2026-05-21 https://github.com/twigphp/Twig GHSA-35wc-cvqg-78fp
5.3
CVSS 4.0 · Vendor: https://github.com/twigphp/Twig
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Identify persistent PHP worker deployment using twig/intl-extra < 3.26.0
  2. Delivery
    Locate endpoint that renders Twig template with user-influenced locale/pattern filter arguments
  3. Exploit
    Send high volume of requests cycling through many distinct argument values
  4. Install
    IntlExtension allocates unbounded ICU formatter objects per unique value
  5. C2
    ICU heap grows outside PHP memory_limit accounting
  6. Execute
    Worker process RSS exhausted
  7. Impact
    Denial 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

composer twig/intl-extra fix: 3.26.0

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

Vendor (https://github.com/twigphp/Twig) PRIMARY 5.3 MEDIUM
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

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
CVSS changed
Jul 14, 2026 - 22:22 NVD
5.3 (MEDIUM)

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

EPSS Score
0.1%
Top 82% exploitable
Threat Intel
1
1 source
Data Quality
4 sources
Confidence: Medium

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Affected Products (CPE)CVE.org

pkg:composer/twig_intl-extra

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy