Skip to main content

Twig CVE-2026-133768

| EUVDEUVD-2026-133917 MEDIUM
Incorrect Authorization (CWE-863)
2026-11-24 Symfony
5.3
CVSS 4.0 · Vendor: Symfony
View

Attack ChainAIDerived

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

  1. Access
    Authenticate as sandbox template author
  2. Exploit
    Submit template with {{ obj|join(',') }}
  3. Execution
    Filter casts object via (array) exposing all properties
  4. Impact
    Render leaks private/protected property values

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V8 - Authorization Authorization logic validation
MITRE ATT&CK

1 technique across 1 tactic: Privilege Escalation

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

Exploitation Conditions

Exploitation requires all of: (1) the application runs Twig in sandbox mode with a security policy; (2) that policy allows the join filter; (3) an attacker who is permitted to author or submit template source in that sandbox; and (4) a non-iterable object (e.g. a domain object with private/protected properties) is reachable in the template context. The attack is limited by the fact that default, non-sandboxed Twig usage is unaffected, and by the policy itself - if join is not in the allowed-filter list the bypass is unavailable. Impact is limited to disclosure of object property values; it does not grant method invocation, write access, or code execution. A Stringable object's exposure remains governed by the policy after the fix.

Impact

This is a genuine but bounded sandbox-escape information-disclosure flaw, not a high-urgency emergency. The supplied CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N, score 5.3) and CWE-863 (Incorrect Authorization) align well with the mechanism: a low-privileged actor who is permitted to author or submit templates in Twig's sandbox mode can read object properties the sandbox policy is supposed to withhold. Impact is confidentiality-only and rated Low - no integrity or availability effect, no code execution, no scope change asserted by the vendor. The vuln.today decision label is 'this_month' (routine patch cadence), which is consistent with the absence of exploitation signals: there is no CISA KEV listing and no EPSS probability supplied, so there is no evidence of active or automatable exploitation. No working exploit code is referenced - only a vendor advisory, GHSA advisory, and the fix commit are provided; note the public patch commit itself reveals the one-line root cause and could ease exploit development. Real-world risk is confined to applications that actually run Twig in sandbox mode AND allow the join filter AND expose sensitive objects to untrusted template authors; most Twig deployments do not sandbox at all and are unaffected. Treat as a priority only for multi-tenant/CMS/template-builder platforms matching that profile.

Exploit ScenarioDerived

An application that lets semi-trusted users author Twig templates in sandbox mode (e.g. a CMS, email/notification template builder, or reporting tool) exposes an object such as the current user. An attacker who is an allowed template author writes {{ user|join(',') }}, which casts the non-iterable object to an array and concatenates all properties - including private and protected ones the sandbox policy denies - leaking data they could not otherwise read. No working public exploit is referenced, but the payload is trivial and the fix commit is public.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.5% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Nov 24, 2026

Sandboxed Twig templates that are permitted to use the join filter can disclose the private and protected properties of non-iterable objects, bypassing the sandbox security policy's property allow-list. The filter cast non-iterable values with (array) $value, which expands any object into all of its properties - including ones the policy denies and that templates cannot read through any other construct - so a construct such as {{ user|join(',') }} printed them. Only applications that run Twig in sandbox mode with a policy that allows join, and where a non-iterable domain object is reachable in the template context, are affected; an attacker must be able to author or submit template source in that sandbox (authenticated per the CVSS vector, PR:L), impact is confined to property-value disclosure with no write or code-execution path, and no public exploit was identified at time of analysis.

RemediationAI

Upgrade twig/twig to 3.31.1 or later - the vendor-released patch, available as commit 6bcede134671133a4a056199af5cf4749d189d72 on the 3.x branch and detailed in GHSA-p2x6-ppf3-32r3 and https://symfony.com/cve-2026-133768 - after which non-iterable values are joined as a single item, Stringable output remains governed by the security policy, and other objects raise an error instead of leaking properties. If upgrading cannot be done immediately, remove join from the allowed-filters list of the sandbox SecurityPolicy for any template that renders untrusted source; the trade-off is that legitimate templates relying on join for sequences will fail until the upgrade lands. As a complementary control, restrict who may author or submit template source into sandboxed environments, since the bypass requires that capability, and audit sandbox policies that both allow join and expose rich domain objects to template context. Given the vendor-rated decision priority of this_month, schedule the upgrade within the normal monthly patch cycle rather than as an emergency change.

Affected VersionsENISA

twig/twig 0 <3.31.1

Affected Packages

euvd twig_twig fix: 3.31.1

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 is a PHP templating engine whose sandbox extension (Twig\Extension\SandboxExtension plus a SecurityPolicyInterface) lets an application render untrusted template source while restricting which tags, filters, functions, methods and properties templates may use. The sandbox's property allow-list is the control that prevents templates from reading arbitrary object internals. The join filter in src/Extension/CoreExtension.php handled values that are not sequences by casting them with (array) $value; in PHP that cast on an object yields an associative array of every declared property, including private and protected ones. The result was an incorrect-authorization condition (CWE-863): a template confined by policy could reach data the policy explicitly denies. The upstream fix replaces the cast with null === $value ? [] : [$value], so a non-iterable value is joined as a single item - null yields an empty string, a Stringable object is rendered through its __toString() with that method still subject to policy checking (a denied __toString raises SecurityNotAllowedMethodError), and other objects throw a RuntimeError about conversion to string, matching the behaviour of the first and last filters. The commit also documents the new semantics in doc/filters/join.rst, adds fixtures to tests/Fixtures/filters/join.test, and adds sandbox regression tests covering both the non-iterable-object and Stringable cases. Default, non-sandboxed Twig usage is unaffected, and no trigger beyond the filter/policy interaction is described in the available sources.

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 (Symfony) PRIMARY 5.3 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
vuln.today AI 4.3 MEDIUM

Template author is a low privilege so PR:L; server-side rendering over the app makes AV:N/AC:L; confidentiality-only disclosure of some properties gives C:L, I/A:N.

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

Primary rating from Vendor (Symfony).

CVSS VectorVendor: Symfony

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

DescriptionCVE.org

The join filter converted a value that isn't iterable with (array) $value. For an object, that gives every property, including the private and protected ones. A sandboxed template allowed to use join could therefore print properties that the policy denies, and that templates can't read otherwise:

{{ user|join(',') }}

A value that isn't iterable is now joined as a single item. A Stringable object prints its checked string, and other objects throw, as with the first and last filters.

Threat Intelligence Overview

EPSS Score
0.5%
Top 62% exploitable
Prevalence
High
Twig is a very widely deployed PHP templating engine (Symfony, Drupal, many apps)
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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.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· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
High

Priority Score

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

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

More in Twig

View all
CVE-2018-13818 CRITICAL POC
9.8 Jul 10

Twig before 2.4.4 allows Server-Side Template Injection (SSTI) via the search search_key parameter. Rated critical sever

CVE-2026-24425 HIGH
8.7 May 20

Sandbox bypass in Twig template engine versions 2.16.x and 3.9.0 through 3.25.x allows attackers with template rendering

CVE-2024-45411 HIGH
8.6 Sep 09

Twig is a template language for PHP. Rated high severity (CVSS 8.6), this vulnerability is remotely exploitable, no auth

CVE-2022-39261 HIGH
7.5 Sep 28

Twig is a template language for PHP. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no auth

CVE-2015-7809 MEDIUM
6.8 Nov 06

The displayBlock function Template.php in Sensio Labs Twig before 1.20.0, when Sandbox mode is enabled, allows remote at

CVE-2026-46627 HIGH
7.1 Jul 14

Denial-of-service via resource exhaustion affects the Twig templating engine for PHP prior to 3.26.0, where the sandbox

CVE-2023-46734 MEDIUM
6.1 Nov 10

Symfony is a PHP framework for web and console applications and a set of reusable PHP components. Rated medium severity

CVE-2026-133767 MEDIUM
5.3 Nov 24

Twig's security sandbox allow-list can be bypassed by a sandboxed template that uses the `embed` tag with a parent expre

CVE-2026-133765 MEDIUM
5.3 Nov 24

Sandbox policy bypass in Twig 3.23.0 through 3.31.0 lets whoever supplies the template source force the engine to invoke

CVE-2026-133763 MEDIUM
5.3 Nov 24

A sandbox policy bypass in the Twig template engine (versions 3.21.0 through 3.30.x, fixed in 3.31.1) lets a template au

CVE-2019-9942 LOW
3.7 Mar 23

A sandbox information disclosure exists in Twig before 1.38.0 and 2.x before 2.7.0 because, under some circumstances, it

CVE-2026-133771 LOW
2.3 Nov 24

Twig's autoescaping logic can print attacker-controlled values without HTML escaping when a template contains a macro im

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