CVE-2026-46635 — Vulnerability in twig/twig — CVE Details
Twig: Sandbox property allowlist bypass via the `column` filter (array_column on objects)
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.33%). Schedule for your next planned update.
Does your project use an affected twig/twig version?
Paste your composer.lock to check it for CVE-2026-46635 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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.
Advisory Timeline
- First published May 21, 2026 (189 days ago).
- Last revised September 10, 2026 — 111 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
composer require "twig/twig:^3.26.0"
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: Packagist (1).
| Package | Fixed In |
|---|---|
| twig/twig Packagist · Affected: 1.3.0, 1.4.0, 1.5.0, 1.5.1 (+238 more) | 3.26.0 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-863Incorrect AuthorizationMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 2.5 score means for each attack dimension.
CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
References
Frequently Asked Questions
- What is CVE-2026-46635?
- Twig: Sandbox property allowlist bypass via the `column` filter (array_column on objects). This vulnerability has been assigned a severity rating of LOW (CVSS score: 2.5/10).
- How do I check if my project is affected by CVE-2026-46635?
- CVE-2026-46635 affects twig/twig. It has a 0.3% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-46635 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation is difficult, or the impact is minor.
This is a below-median EPSS score — only 18.7% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-46639HIGH
Twig: Sandbox property and method bypass via object-destructuring assignment
- CVE-2026-47732HIGH
Twig: Sandbox: multiple `__toString()` policy bypasses via unguarded string coercion points
- CVE-2026-46634MEDIUM
Twig: `template_from_string()` escapes a SourcePolicy-driven sandbox via synthesized template name
- CVE-2026-48807MEDIUM
Twig: Sandbox `__toString()` policy bypass via `Traversable` in `join` and `replace` filters
- CVE-2026-48808MEDIUM
Twig: Sandbox property allowlist bypass via the `column` filter under `SourcePolicyInterface`
- CVE-2026-47730LOW
Twig: XSS in profiler HtmlDumper via unescaped template and profile names
- CVE-2024-51755LOW
Twig has unguarded calls to `__isset()` and to array-accesses when the sandbox is enabled
- CVE-2026-48805LOW
Twig: Sandbox state regression in deprecated internal wrappers in `src/Resources/core.php`