CVE-2026-46627
JSON

7.1high

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

Severity
7.1high CVSS:4.0 by GitHub_M
Exploit likelihood
0.39% (higher than 34% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M

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.

Affected

Product or packageVersionsReported by
twigphp Twig< 3.26.0CVE List
symfony twigbefore 3.26.0NVD

All scores

GitHub_M7.1high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
NVD6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-400

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

Twig es un lenguaje de plantillas para PHP. Antes de 3.26.0, el sandbox de Twig no impide que una plantilla consuma CPU, memoria o tiempo de reloj de pared, incluso bajo la lista de permitidos más estricta, permitiendo que plantillas no confiables causen agotamiento de recursos. Este problema se aborda en la versión 3.26.0 al documentar que el sandbox no protege contra el agotamiento de recursos.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-46627 changed 2026-07-16CVE Terms of Use
NVDCVE-2026-46627 changed 2026-10-24Public domain