CVE-2026-46627 Twig: Sandbox resource exhaustion via unbounded `for` / `range()`

High 7.1 Published Updated
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.

Sources

Also known as DEBIAN-CVE-2026-46627, GHSA-923g-j88x-j34q, UBUNTU-CVE-2026-46627.

Is CVE-2026-46627 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free