CVE-2026-46635
Twig: Sandbox property allowlist bypass via the `column` filter (array_column on objects)
描述
### 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.
受影響套件(2)
- Debian/php-twigfrom 0
- Packagist/twig/twigfrom 0, < 3.26.0
CVSS 分數
| 來源 | 版本 | 嚴重程度 | 向量 |
|---|---|---|---|
| osv | CVSS 4.0 | — | 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 |
參考連結(5)
- ADVISORYhttps://security-tracker.debian.org/tracker/CVE-2026-46635
- PATCHhttps://github.com/twigphp/Twig
- WEBhttps://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-46635.yaml
- WEBhttps://github.com/twigphp/Twig/security/advisories/GHSA-vcc8-phrv-43wj
- WEBhttps://symfony.com/cve-2026-46635