Affected Versions
All 2.0.X, 2.1.X, 2.2.X, 2.3.X, 2.4.X, 2.5.X, and 2.6.X versions of the Symfony HttpKernel component are affected by this security issue.
This issue has been fixed in Symfony 2.3.27, 2.5.11, and 2.6.6. Note that no fixes are provided for Symfony 2.0, 2.1, 2.2, and 2.4 as they are not maintained anymore.
Description
Applications with ESI support (and SSI support as of Symfony 2.6) enabled and
using the Symfony built-in reverse proxy (the
`Symfony\Component\HttpKernel\HttpCache
class) are vulnerable to PHP code injection; a malicious user can inject PHP code that will be executed by the server.
HttpCache
uses eval()
to execute files in its cache when they contain ESI tags (and only when ESI is enabled). The vulnerability comes from the fact that PHP allows contents of <script language="php">
tags to be executed (and this kind of PHP tags is always available regardless of the configuration), but there were not escaped before the evaluation.
A possible exploit comes from websites also vulnerable to Cross-Site Scripting as an attacker can successfully conduct a PHP code injection attack by passing such a tag in a user submitted variable (for which proper output escaping was not applied).
Resolution
The fix implements a much stricter escaping on user submitted values to remove the possibility to inject PHP code.
The patch for this issue is available here.
Credits
I would like to thank Takeshi Terada of Mitsui Bussan Secure Directions, Inc. for reporting this security issue and Nicolas Grekas of Blackfire.io for providing a fix.
The affected versions in the vulnerabilities seems wrong. It states
[>=2.0.0, <2.1.0] [>=2.1.0, <2.2.0] [>=2.2.0, <2.3.0] [>=2.3.0, <2.3.19] [>=2.4.0, <2.4.9] [>=2.5.0, <2.5.4]
but this would allow for insecure version, if you say all versions are affected.
I think it should be
[>=2.0.0, <2.1.0] [>=2.1.0, <2.2.0] [>=2.2.0, <2.3.0] [>=2.3.0, <2.3.27] [>=2.4.0, <2.4.0] [>=2.5.0, <2.5.11] [>=2.6.0, <2.6.6]
Sorry, meant
[>=2.0.0, <2.1.0] [>=2.1.0, <2.2.0] [>=2.2.0, <2.3.0] [>=2.3.0, <2.3.27] [>=2.4.0, <2.5.0] [>=2.5.0, <2.5.11] [>=2.6.0, <2.6.6]
Oh damn, I should read better. I saw only ESI in the one, but it was a ESI vulnerability from last year. Shame on me :O!
it would be nice to add this to the security advisory database so it's catched by the security scanner (looks like a pull request is there - https://github.com/xabbuh/security-advisories/commit/61935bd2f125e54c3907a40f91b2bc7f4fe9e7d6)
This is huge ! I didn't know the