CVE-2026-46627 PUBLISHED

Twig: Sandbox resource exhaustion via unbounded `for` / `range()`

Assigner: GitHub_M
Reserved: 15.05.2026 Published: 14.07.2026 Updated: 14.07.2026

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.

Metrics

CVSS Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
CVSS Score: 7.1

Product Status

Vendor twigphp
Product Twig
Versions
  • Version < 3.26.0 is affected

References

Problem Types

  • CWE-400: Uncontrolled Resource Consumption CWE