Twig: Sandbox property and method bypass via object-destructuring assignment
Twig is a template language for PHP. From 3.24.0 until 3.26.0, object-destructuring assignment compiles CoreExtension::getAttribute() with the sandbox argument hardcoded to false, disabling property and method policy checks and allowing an attacker with write access to a sandboxed Twig template to read public properties or invoke public getters on objects passed to the template engine. This issue is fixed in version 3.26.0.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2026-46639
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 7 Nov 2026, 06:54 UTC · Revision 1
Source evidence
Twig: Sandbox property and method bypass via object-destructuring assignment
core-osv · Original sourcePublished 14 Jul 2026, 21:13 UTC
Twig is a template language for PHP. From 3.24.0 until 3.26.0, object-destructuring assignment compiles CoreExtension::getAttribute() with the sandbox argument hardcoded to false, disabling property and method policy checks and allowing an attacker with write access to a sandboxed Twig template to read public properties or invoke public getters on objects passed to the template engine. This issue is fixed in version 3.26.0.
osv:CVE-2026-46639
Complete source record
{
"id": "8e714dc2c4afcf5953e2ab94ae24869b07d021cf596e0282fe31c09f97e57942",
"url": "https://osv.dev/vulnerability/CVE-2026-46639",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Twig: Sandbox property and method bypass via object-destructuring assignment",
"summary": "Twig is a template language for PHP. From 3.24.0 until 3.26.0, object-destructuring assignment compiles CoreExtension::getAttribute() with the sandbox argument hardcoded to false, disabling property and method policy checks and allowing an attacker with write access to a sandboxed Twig template to read public properties or invoke public getters on objects passed to the template engine. This issue is fixed in version 3.26.0.",
"evidence": "osv:CVE-2026-46639",
"products": [],
"severity": "high",
"structured": {
"id": "CVE-2026-46639",
"aliases": [
"CVE-2026-46639",
"GHSA-mm6w-gr99-p3jj"
],
"metrics": [
{
"type": "CVSS_V4",
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/twigphp/twig",
"type": "GIT",
"events": [
{
"introduced": "a6769aefb305efef849dc25c9fd1653358c148f0"
},
{
"fixed": "1fcae487b180d78e6351f4e0afa91f9eab96a2bc"
}
],
"database_specific": {
"extracted_events": [
{
"range": [
{
"introduced": "3.24.0"
},
{
"fixed": "3.26.0"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StringRangeExpression"
},
{
"range": [
{
"fixed": "1fcae487b180d78e6351f4e0afa91f9eab96a2bc"
}
],
"source": "REFERENCES_TAG",
"original_tag": "v3.26.0"
},
{
"cpe": "cpe:2.3:a:symfony:twig:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "3.24.0"
},
{
"fixed": "3.26.0"
}
],
"source": "CPE_RANGE"
}
]
}
}
],
"versions": [
"v3.25.0",
"v3.24.0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-46639.json"
}
}
],
"modified": "2026-10-28T02:30:49.990147275Z",
"provider": "osv",
"references": [
"https://github.com/twigphp/Twig/releases/tag/v3.26.0",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/46xxx/CVE-2026-46639.json",
"https://github.com/twigphp/Twig/security/advisories/GHSA-mm6w-gr99-p3jj",
"https://nvd.nist.gov/vuln/detail/CVE-2026-46639"
],
"provider_metadata": {
"cwe_ids": [
"CWE-693"
],
"cna_assigner": "GitHub_M",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/46xxx/CVE-2026-46639.json"
}
},
"related_cves": [
{
"value": "CVE-2026-46639",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 518556,
"published_at": "2026-07-14T21:13:42.321+00:00"
}