CVE-2015-7809:
Twig remote code execution in templates
8.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.83029%
CWE
Published
5/14/2022
Updated
5/30/2024
KEV Status
No
Technology
PHP
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
twig/twig | composer | < 1.20.0 | 1.20.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the displayBlock method not validating that the template instance is a Twig_Template. The GitHub patch adds a critical type check (instanceof Twig_Template) to prevent execution of arbitrary objects. This aligns with the CVE description about _self variable abuse in sandbox mode. The test case added in TemplateTest.php confirms the exploit vector involved passing non-Twig_Template objects to displayBlock.