Skip to main content

Twig EUVDEUVD-2026-44559

| CVE-2026-46627 HIGH
Uncontrolled Resource Consumption (CWE-400)
2026-07-14 security-advisories@github.com
7.1
CVSS 4.0 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Access template-rendering feature
  2. Delivery
    Submit malicious Twig template
  3. Exploit
    Trigger nested loops/recursive macros
  4. Execution
    Exhaust CPU and memory
  5. Impact
    Worker killed / service denied

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource consumption limits
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the target application render untrusted, attacker-influenced Twig templates - the vulnerable path is the Twig sandbox itself, and crucially the sandbox being enabled provides NO protection here. The attacker needs the ability to author or inject template source (reflected by PR:L), so applications that render only trusted, developer-authored templates are not exposed. What limits exploitation: the attacker must reach a template-rendering feature, the impact is availability-only (no data disclosure or code execution), and any process-level resource caps already in place (memory_limit, execution timeouts, cgroups) directly blunt or neutralize the attack. No user interaction is required and the attack is network-reachable with low complexity where template submission is exposed.

Impact

This is a genuine but bounded (availability-only) risk. The provided CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:L/UI:N, VC:N/VI:N/VA:H) scores 7.1 and correctly reflects a network-reachable, low-complexity attack whose sole impact is availability, requiring low privileges - meaning the attacker must have some ability to submit or influence the template being rendered. All exploitation signals point to low urgency: SSVC records Exploitation=none, Automatable=no, Technical Impact=partial; EPSS is 0.33% (25th percentile); and it is not KEV-listed with no public exploit code. A key nuance: the PR:L in the vector implies the attacker needs template-authoring capability, so real-world exposure hinges entirely on whether an application actually exposes template rendering to untrusted input - most deployments render only developer-authored templates and are effectively not exposed. This is therefore a design-limitation advisory to be aware of, not an emergency patch priority.

Exploit ScenarioDerived

An application lets users supply or edit Twig templates (e.g. a SaaS email/report builder) and renders them server-side within the sandbox, trusting the allow-list for safety. An attacker submits a template with deeply nested loops over a large range or a recursive macro, and rendering pins a CPU core and inflates memory until the worker is killed or times out, degrading or denying service for other tenants. No public proof-of-concept is identified, but the technique is trivial to construct given low-complexity network access and template-submission privileges.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 22, 2026

Denial-of-service via resource exhaustion affects the Twig templating engine for PHP prior to 3.26.0, where the sandbox - even under its strictest allow-list - does not bound CPU, memory, or wall-clock consumption of a rendered template. Any application that renders untrusted or user-supplied templates can be forced to exhaust host resources through large ranges, nested loops, recursive macros, or expensive filters. There is no public exploit identified and it is not in CISA KEV; EPSS is low (0.33%), and the vendor's 3.26.0 'fix' only documents the limitation rather than adding a code-level control.

RemediationAI

Vendor-released patch: 3.26.0 - but note this release is a documentation change (commit 6bfa285e2f98651adb7aa480bf83a741d154f09f updates doc/sandbox.rst), not a functional mitigation; upgrading does not add any resource limit. Because Twig explicitly declines to enforce limits at the engine level (any built-in cap being 'arbitrary and trivial to work around'), the effective remediation is process-level containment of untrusted template rendering: run rendering in an isolated worker/process with hard caps via PHP settings (memory_limit, max_execution_time) and OS controls (ulimit, cgroups CPU/memory quotas), and enforce request timeouts at the web/app server. Where feasible, avoid rendering attacker-controlled templates at all, or constrain inputs (limit loop/range sizes, template length, include depth) before rendering. Trade-off: aggressive memory_limit/timeout caps can terminate legitimate large renders, so tune per workload. See GHSA-923g-j88x-j34q for the vendor's guidance to 'contain them at the process level rather than at the template engine level.'

Affected VersionsENISA

Twig < 3.26.0

Affected Packages

euvd twig fix: 3.26.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Twig compiles template source into PHP and offers a sandbox mode to safely render untrusted templates by restricting which tags, filters, functions, methods, and properties are reachable. The sandbox is an access-control boundary, not a resource-control boundary - it governs WHAT a template may touch, not HOW MUCH compute it may consume. This maps directly to CWE-400 (Uncontrolled Resource Consumption): constructs that are individually permitted (loops, ranges, string operations, macro recursion, includes) can be composed to burn unbounded CPU/memory/time. The affected component per CPE is cpe:2.3:a:symfony:twig, i.e. the twigphp/Twig library, historically maintained under the Symfony ecosystem and embedded in frameworks such as Symfony and Drupal.

Know when Twig gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (github) PRIMARY 7.1 HIGH
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
vuln.today AI 6.5 MEDIUM

Network-reachable, low-complexity DoS requiring template-submission privileges (PR:L); no confidentiality or integrity impact, availability-only (A:H), scope unchanged.

3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Jul 14, 2026 - 23:20 EUVD
CVE Published
Jul 14, 2026 - 22:16 cve.org
HIGH 7.1

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

Twig templating engine (PHP versions prior to 3.26.0) contains a denial-of-service vulnerability enabling resource exhaustion when rendering untrusted templates-a critical risk for platforms accepting user-generated content or dynamic templates. Without CPU, memory, or execution-time limits in Twig's sandbox, attackers can crash or severely degrade service availability through crafted templates with loops, macros, or expensive filters. No public exploit identified at time of analysis, with current exploit probability at 0.3%, but immediate assessment of template-handling practices is required to prevent potential service disruption.

Business Impact: High
Compensating Controls

Vendor-released patch: Twig 3.26.0 (note: this release documents the limitation rather than implementing code-level mitigations). Interim controls: (1) Enforce per-application resource limits (max_execution_time, memory_limit) at the PHP/script level; (2) Prefer pre-approved, whitelisted templates over dynamic user-supplied templates; (3) Implement request-level rate limiting and timeouts on template rendering operations; (4) Monitor server resource consumption (CPU, memory) for anomalous spikes; (5) Deploy WAF rules to detect and reject templates with characteristics of resource-exhaustion attacks (e.g., loops with large ranges, deeply nested macros, expensive filters).

Threat Intelligence Overview

EPSS Score
0.3%
Top 75% exploitable
Prevalence
High
widely-used PHP template engine embedded in Symfony, Drupal, and many apps
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Partial

Priority Score

36
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +36
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy