CVE-2026-46638 — Vulnerability in twig/twig — CVE Details
Twig: `{% sandbox %}{% include %}` skips checkSecurity() on cached templates (incomplete fix for CVE-2024-45411)
Summary
Advisory Timeline
- First published May 21, 2026 (144 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, run your dependency scanner again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: packagist (1).
| Package | Ecosystem | Affected | Fixed In |
|---|---|---|---|
| twig/twig | packagist | 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-693Protection Mechanism FailureMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 9.5 score means for each attack dimension.
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:H
References
- https://github.com/twigphp/Twig/security/advisories/GHSA-7fxw-r6jv-74c8WEB
- https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-46638.yamlWEB
- https://github.com/advisories/GHSA-6j75-5wfj-gh66ADVISORY
- https://github.com/twigphp/TwigPACKAGE
- https://symfony.com/cve-2026-46638WEB
Frequently Asked Questions
- What is CVE-2026-46638?
- Twig: `{% sandbox %}{% include %}` skips checkSecurity() on cached templates (incomplete fix for CVE-2024-45411) This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 9.5/10).
- How do I check if my project is affected by CVE-2026-46638?
- CVE-2026-46638 affects twig/twig. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-46638 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation is straightforward and causes maximum impact. Patch immediately.
Also Known As
Related CVEs
- CVE-2026-46633CRITICAL
Twig: PHP code injection via `{% use %}` template name
- CVE-2026-24425HIGH
Twig: Possible sandbox bypass when using a source policy
- CVE-2026-46640HIGH
Twig: Arbitrary PHP code execution via `_self.(<string>)` macro-reference compilation
- CVE-2026-46639HIGH
Twig: Sandbox property and method bypass via object-destructuring assignment
- CVE-2026-75592MEDIUM
Kirby: Access to image files outside of the site root via path traversal in the media handling
- CVE-2024-45411MEDIUM
Twig has a possible sandbox bypass
- CVE-2026-88023MEDIUM
MongoDB: GridFS data disclosure and deletion via query-operator injection in file IDs
Check if you're affected
Scan your dependencies to see if this vulnerability affects your projects.
Scan Your Dependencies