CVE-2026-46627

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

MEDIUM
6.5
CVSS Score
Published: July 14, 2026 at 09:15 PM UTC
Updated: October 24, 2026 at 10:10 PM UTC
2 products affected across 2 vendorsTwigTwig

Using Twig by twigphp?

Get instant alerts when new vulnerabilities affect Twig - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM6.5
Exploit prediction
EPSS 0.5%
SSVC
No known exploit

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

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 3.26.0
Affected range stops below 3.26.0, so it looks safe — our inference, not a vendor statement
v < 3.26.0
Affected range stops below 3.26.0, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

References (3)

x_refsource_CONFIRMVendor Advisory
Source: cverecord
https://github.com/twigphp/Twig/security/advisories/GHSA-923g-j88x-j34q
x_refsource_MISCRelease Notes
Source: cverecord
https://github.com/twigphp/Twig/releases/tag/v3.26.0

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
NETWORK
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusANALYZED
CWE
CWE-400

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card