You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of Smarty v3.1.28, a block in a compiled template has a PHP comment wrapped around it that indicates the resource and name of the template that the block is contained in. The problem is that the "name" of a string resource's template is actually the entire template contents. This can allow for exploitable code in some situations. Consider this example:
Note the "2016". Because the template content is embedded to the compiled template as-is, the PHP comment can be closed and re-opened, and anything in between will be executed as raw PHP code. Obviously the echo command could be replaced with an exec or otherwise to do "bad things".
If there are other internal compiler plugins that add comments like the block plugin, those should probably be checked for similar exploits.
The text was updated successfully, but these errors were encountered:
As of Smarty v3.1.28, a block in a compiled template has a PHP comment wrapped around it that indicates the resource and name of the template that the block is contained in. The problem is that the "name" of a string resource's template is actually the entire template contents. This can allow for exploitable code in some situations. Consider this example:
this will output:
Note the "2016". Because the template content is embedded to the compiled template as-is, the PHP comment can be closed and re-opened, and anything in between will be executed as raw PHP code. Obviously the
echo
command could be replaced with anexec
or otherwise to do "bad things".If there are other internal compiler plugins that add comments like the block plugin, those should probably be checked for similar exploits.
The text was updated successfully, but these errors were encountered: