Skip to main content

Twig CVE-2026-46635

MEDIUM
Incorrect Authorization (CWE-863)
2026-05-21 https://github.com/twigphp/Twig GHSA-vcc8-phrv-43wj
5.3
CVSS 4.0 · Vendor: https://github.com/twigphp/Twig
View

Attack ChainAIDerived

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

  1. Access
    Obtain untrusted template author access in sandboxed Twig app
  2. Delivery
    Craft template invoking `column` filter against context object array
  3. Exploit
    `array_column()` reads object properties via PHP native code path
  4. Execution
    `SandboxExtension::checkPropertyAllowed()` never invoked
  5. Persist
    Restricted object properties returned in rendered output
  6. Impact
    Exfiltrate sensitive data from response

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 three of the following specific conditions to be met simultaneously. First, the application must be running Twig in sandbox mode with an active SecurityPolicy that restricts allowedProperties - this is not a default Twig configuration and must be explicitly constructed by the application developer. Second, the attacker must have been granted untrusted template authorship in that sandbox, and the SecurityPolicy's allowedFilters list must include the column filter - if column is absent from allowedFilters, the bypass is not reachable. Third, the render context must contain arrays of PHP objects (not plain PHP arrays or scalars) that carry sensitive or restricted properties. What limits exploitation: applications not using sandbox mode are entirely unaffected (they have no property allowlist to bypass); applications using sandbox mode but not exposing column in allowedFilters are unaffected; contexts that pass only plain arrays or scalar values to column are unaffected. Exploitation is read-only - the described mechanism discloses property values but does not enable code execution or property mutation.

Impact

No CVSS score or vector is provided for CVE-2026-46635, so quantitative severity cannot be confirmed and must be inferred from the advisory context. No EPSS score is available. The vulnerability is not listed in the CISA KEV catalog, and no public exploit code has been identified at time of analysis. Despite the absence of a CVSS score, the real-world risk is meaningful but tightly scoped: exploitation requires three non-default conditions to coincide - sandbox mode must be active, the attacker must be a delegated untrusted template author, and the column filter must appear in allowedFilters. Applications not using Twig sandbox mode have no exposure. Where those conditions are met, however, the information disclosure impact can be severe: any object in the render context - potentially carrying credentials, tokens, or internal state - is readable without restriction. The absence of a CVSS vector makes it impossible to confirm whether exploitation is network-accessible or requires local access from available data alone; the advisory implies a web request context where an attacker-controlled template is rendered server-side. The close relationship to CVE-2024-51755 suggests the vulnerability class is well understood by researchers, meaning independent rediscovery and exploitation by third parties is plausible even without a published POC.

Exploit ScenarioDerived

An attacker operating as an untrusted template author in a multi-tenant or user-templating application submits a Twig template containing {{ users|column('apiKey') }}, where users is an array of User objects present in the render context. On unpatched versions, PHP's array_column() reads the apiKey property directly on each object without invoking SandboxExtension::checkPropertyAllowed(), returning the values to the rendered output even though apiKey is absent from the SecurityPolicy's allowedProperties list. No public proof-of-concept code has been identified, but the bypass is fully described in the advisory and trivially reproducible by any developer familiar with the Twig sandbox internals.

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

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

Alert me

AnalysisAIv1 – May 21, 2026

Twig's sandbox security policy is bypassed via the column filter when processing arrays of PHP objects, allowing an untrusted template author to read any public or magic property of any object reachable in the render context - completely circumventing the SecurityPolicy's allowedProperties restrictions. All twig/twig versions prior to 3.26.0 are affected when sandbox mode is active and untrusted authors have column in their allowedFilters. This is a structural variant of CVE-2024-51755 that the prior ArrayAccess-focused fix left uncovered; no public exploit has been identified at time of analysis, and the fix is confirmed in Twig 3.26.0.

RemediationAI

Upgrade twig/twig to version 3.26.0 or later, which is the vendor-released patch confirmed by the GitHub Security Advisory GHSA-vcc8-phrv-43wj (https://github.com/twigphp/Twig/security/advisories/GHSA-vcc8-phrv-43wj) and the FriendsOfPHP advisory database. Run composer update twig/twig and verify the installed version reaches 3.26.0. If immediate patching is not possible, remove column from the allowedFilters array in the sandbox SecurityPolicy configuration - this eliminates the attack vector entirely but will break any templates that rely on the column filter, requiring template modifications as a side effect. A second partial mitigation is to audit what objects are passed into the render context and strip or replace sensitive objects with plain-array representations before rendering untrusted templates; however, this is difficult to enforce comprehensively and is not a substitute for patching. Do not rely on the allowedProperties list alone as a security boundary on unpatched versions, as this CVE confirms it can be bypassed.

Affected Packages

composer twig/twig fix: 3.26.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in composer

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

Technical ContextAI · show details

Twig's sandbox mode enforces property access control through SandboxExtension::checkPropertyAllowed(), which is invoked exclusively via CoreExtension::getAttribute() - the standard Twig attribute accessor. The column filter (pkg:composer/twig/twig, all versions < 3.26.0) delegates directly to PHP's native array_column() function without routing through CoreExtension::getAttribute(). When the input array contains objects, PHP's array_column() reads $obj->$name and $obj->$index using the engine's own property resolution, including triggering __get and __isset magic methods. Because this entire read path executes inside PHP native code, it never reaches CoreExtension::getAttribute(), so SandboxExtension::checkPropertyAllowed() is never consulted. The root cause is classified as CWE-863 (Incorrect Authorization): the authorization gate exists but is bypassable via an alternative execution path. The fix in 3.26.0 routes object property reads from the column filter through the sandbox-aware attribute accessor, ensuring the allowedProperties list is enforced consistently. This mirrors the mechanism of CVE-2024-51755 (GHSA-jjxq-ff2g-95vh), which fixed an analogous bypass through ArrayAccess-implementing objects, but that patch addressed only the ArrayAccess branch and left the plain-object array_column() path unchecked.

Know when PHP 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 (https://github.com/twigphp/Twig) 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

Primary rating from Vendor (https://github.com/twigphp/Twig) · only source for this CVE.

CVSS VectorVendor: https://github.com/twigphp/Twig

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

Lifecycle Timeline

1
CVSS changed
Jul 14, 2026 - 22:22 NVD
5.3 (MEDIUM)

DescriptionCVE.org

Description

The column filter passes its input straight to PHP's native array_column(). When the array elements are objects, array_column() reads $obj->$name (and $obj->$index) directly, including invoking __get/__isset. Because this property read happens entirely in PHP native code and never reaches CoreExtension::getAttribute(), SandboxExtension::checkPropertyAllowed() is never consulted.

An untrusted template author with column in their allowedFilters list can therefore read any public or magic property of any object reachable in the render context, regardless of the SecurityPolicy allowedProperties list. This is a variant of CVE-2024-51755 / GHSA-jjxq-ff2g-95vh that the ArrayAccess-focused fix did not cover.

Resolution

The column filter now routes object property reads through the sandbox-aware attribute accessor so the property allowlist is enforced.

Credits

Twig: would like to thank Claude Mythos Preview (via Project Glasswing) for reporting the issue and providing the fix.

Threat Intelligence Overview

EPSS Score
0.0%
Top 85% exploitable
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
4 sources
Confidence: Medium

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.0%
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
Medium

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
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.

Affected Products (CPE)CVE.org

pkg:composer/twig_twig

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it

CVE-2012-1823 CRITICAL POC
9.8 May 11

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

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