CVE-2026-46629·PHP vulnerability
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.
- Severity
- medium
- Software
- PHP
- Fixed in
- 3.26.0
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at 0.30% — higher than 23% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Affected versions
Until: 3.26.0
Fixed in: 3.26.0
How to fix this CVE
Update PHP and the Twig templating engine to version 3.26.0 or later to resolve memory exhaustion risks in the intl-extra extension. The vulnerability allows template authors to trigger excessive allocation of formatter objects that persist for the lifetime of the Twig environment, potentially leading to denial of service. Apply security patches through your distribution's package manager as soon as possible.
sudo dnf update phpDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check the installed PHP version by running: php -v
- Step 2: Verify if Twig is installed and its version by running: composer show twig/twig or grep -r 'twig/twig' composer.lock
- Step 3: Search application logs for evidence of template injection or unusual locale/pattern filter arguments in Twig template rendering: grep -i 'intl\|locale\|pattern' /var/log/application.log
- Step 4: After patching, confirm PHP version is >= 5.x with Twig >= 3.26.0 by running: php -v && composer show twig/twig | grep Version
FAQ
What is CVE-2026-46629?
This vulnerability exists in Twig's intl-extra extension, where formatter objects (IntlDateFormatter and NumberFormatter) are cached using template-controlled parameters like locale and pattern as keys, enabling attackers to exhaust server memory by forcing creation of many formatter instances that remain allocated indefinitely.
Is CVE-2026-46629 being actively exploited?
No, this vulnerability is not listed on the CISA Known Exploited Vulnerabilities (KEV) catalog and no public exploits are currently available.
What versions of PHP are affected by CVE-2026-46629?
The vulnerability affects Twig versions prior to 3.26.0, regardless of the underlying PHP version. PHP 5.x through current versions running vulnerable Twig releases are at risk.
How do I check if my server is vulnerable to CVE-2026-46629?
Run `composer show twig/twig` to determine the installed Twig version; if it is below 3.26.0, your system is vulnerable. Additionally, check for intl-extra usage in your application's dependencies with `composer show twig/intl-extra`.
Does Defensia detect CVE-2026-46629?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If PHP and Twig are installed on a monitored server, CVE-2026-46629 will appear in your dashboard with remediation steps.
Related PHP CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-46629. Free for 1 server.
Get started free