Twig remote code execution in templates
The advisory, in context
The displayBlock function Template.php in Sensio Labs Twig before 1.20.0, when Sandbox mode is enabled, allows remote attackers to execute arbitrary code via the _self variable in a template.
Affected packages
Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.
Earlier releases before 1.20.0
Fixed in 1.20.0
46 explicitly affected versions
1.3.0, 1.4.0, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, v1.10.0, v1.10.1, v1.10.2, v1.10.3, v1.11.0, v1.11.1, v1.12.0, v1.12.0-RC1, v1.12.1, v1.12.2, v1.12.3, v1.13.0, v1.13.1, v1.13.2, v1.14.0, v1.14.1, v1.14.2, v1.15.0, v1.15.1, v1.16.0, v1.16.1, v1.16.2, v1.16.3, v1.17.0, v1.18.0, v1.18.1, v1.18.2, v1.19.0, v1.7.0, v1.8.0, v1.8.1, v1.8.2, v1.8.3, v1.9.0, v1.9.1, v1.9.2
View affected-version evidence
{
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.20.0"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"1.3.0",
"1.4.0",
"1.5.0",
"1.5.1",
"1.6.0",
"1.6.1",
"1.6.2",
"1.6.3",
"1.6.4",
"1.6.5",
"v1.10.0",
"v1.10.1",
"v1.10.2",
"v1.10.3",
"v1.11.0",
"v1.11.1",
"v1.12.0",
"v1.12.0-RC1",
"v1.12.1",
"v1.12.2",
"v1.12.3",
"v1.13.0",
"v1.13.1",
"v1.13.2",
"v1.14.0",
"v1.14.1",
"v1.14.2",
"v1.15.0",
"v1.15.1",
"v1.16.0",
"v1.16.1",
"v1.16.2",
"v1.16.3",
"v1.17.0",
"v1.18.0",
"v1.18.1",
"v1.18.2",
"v1.19.0",
"v1.7.0",
"v1.8.0",
"v1.8.1",
"v1.8.2",
"v1.8.3",
"v1.9.0",
"v1.9.1",
"v1.9.2"
]
}References
- https://nvd.nist.gov/vuln/detail/CVE-2015-7809
- https://github.com/twigphp/Twig/pull/1759
- https://github.com/twigphp/Twig/commit/30be07759a3de2558da5224f127d052ecf492e8f
- https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2015-7809.yaml
- https://github.com/twigphp/Twig
- https://symfony.com/blog/security-release-twig-1-20-0
- http://openwall.com/lists/oss-security/2015/08/21/3
- http://openwall.com/lists/oss-security/2015/10/11/2
- http://symfony.com/blog/security-release-twig-1-20-0
- http://www.debian.org/security/2015/dsa-3343