CVE-2026-46635: Twig Sandbox Property Allowlist Bypass Vulnerability

LOW
Advisory Identifier: GHSA-vcc8-phrv-43wj
CWE-863
Published
Advisory Summary

CVE-2026-46635 is a LOW sandbox property allowlist bypass vulnerability (CWE-863: Incorrect Authorization) affecting Twig libraries in the Packagist ecosystem. The issue involves sandbox property allowlist bypass via the `column` filter (array_column on objects). Remediation is available by upgrading affected packages to version 3.26.0.

CVE-2026-46635 at a Glance

CVE Identifier CVE-2026-46635
GHSA Identifier GHSA-vcc8-phrv-43wj
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-863: Incorrect Authorization
Affected Product Twig
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-46635

To remediate this vulnerability, upgrade all affected Twig dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

twig/twig fixed: 3.26.0
Upgrade twig/twig to 3.26.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for twig/twig

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-46635, inspect your project dependencies for Twig:

inspect dependencies for twig/twig

Analyze the terminal output to locate any version of Twig in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.26.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Twig, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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.

CVE-2026-46635 Affected Twig Versions

1 component(s)
Fixed Versions:
3.26.0
Product / Package Ecosystem Affected Versions Fixed Version
twig/twig
Packagist
< 3.26.0
3.26.0

References

Frequently Asked Questions

What is CVE-2026-46635?
CVE-2026-46635 is a security vulnerability in Twig involving Sandbox property allowlist bypass via the `column` filter (array_column on objects) under CWE-863: Incorrect Authorization.
Which Twig versions are affected?
Affected versions include releases prior to 3.26.0 across affected packages: twig/twig.
What version fixes CVE-2026-46635?
Upgrading to 3.26.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is twig/twig affected?
Yes, twig/twig is affected in releases prior to 3.26.0. Upgrade your dependency to 3.26.0 or later.
What CWE is associated with CVE-2026-46635?
CVE-2026-46635 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check Packagist dependencies for CVE-2026-46635?
Run the dependency tree command: 'inspect dependencies for twig/twig'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vcc8-phrv-43wj",
  "modified" : "2026-05-21T21:25:55Z",
  "published" : "2026-05-21T21:25:55Z",
  "aliases" : [ "CVE-2026-46635" ],
  "summary" : "Twig: Sandbox property allowlist bypass via the `column` filter (array_column on objects)",
  "details" : "### Description\n\nThe `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.\n\nAn 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.\n\n### Resolution\n\nThe `column` filter now routes object property reads through the sandbox-aware attribute accessor so the property allowlist is enforced.\n\n### Credits\n\nTwig: would like to thank Claude Mythos Preview (via Project Glasswing) for reporting the issue and providing the fix.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "twig/twig"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.26.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/twigphp/Twig/security/advisories/GHSA-vcc8-phrv-43wj"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-46635.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/twigphp/Twig"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/cve-2026-46635"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-21T21:25:55Z",
    "nvd_published_at" : null
  }
}