CVE-2026-46627 Twig: Sandbox resource exhaustion via unbounded `for` / `range()`
- Exploited in the wild
- Not known
- Fix
- Available
What is CVE-2026-46627?
CVE-2026-46627 is a high-severity vulnerability in twigphp Twig, published on 14 Jul 2026.
Official description
Twig is a template language for PHP. Prior to 3.26.0, the Twig sandbox does not prevent a template from consuming CPU, memory, or wall-clock time, even under the strictest allow-list, allowing untrusted templates to cause resource exhaustion. This issue is addressed in version 3.26.0 by documenting that the sandbox does not protect against resource exhaustion.
Weakness: CWE-400
Which versions are affected by CVE-2026-46627?
It affects 1 product.
Products include Symfony Twig.
How do I fix CVE-2026-46627?
Upgrade to a fixed version.
Is CVE-2026-46627 being exploited?
There is no known exploitation of CVE-2026-46627 in the wild and no public exploit code.
Other vulnerabilities in twigphp Twig
- CVE-2018-13818 Code injection in n/a
- CVE-2026-46633 Twig: PHP code injection via `{% use %}` template name
- CVE-2026-46640 Twig: Arbitrary PHP code execution via `_self.(<string>)` macro-reference compilation
- CVE-2026-24425 Twig 2.16.x & 3.9.0-3.25.x Sandbox Bypass via SourcePolicyInterface
- CVE-2024-45411 Twig has a possible sandbox bypass
Sources
Also known as DEBIAN-CVE-2026-46627, GHSA-923g-j88x-j34q, UBUNTU-CVE-2026-46627.