mirror of
https://github.com/twigphp/Twig.git
synced 2026-11-06 11:15:01 +00:00
Fix sandbox bypass: PHP code injection via {% use %} template name
This commit is contained in:
committed by
Fabien Potencier
parent
afe54db2e5
commit
e9ff55f691
@@ -248,11 +248,11 @@ final class ModuleNode extends Node
|
||||
->string($key)
|
||||
->raw("])) {\n")
|
||||
->indent()
|
||||
->write("throw new RuntimeError('Block ")
|
||||
->write("throw new RuntimeError(sprintf('Block \"%s\" is not defined in trait \"%s\".', ")
|
||||
->string($key)
|
||||
->raw(' is not defined in trait ')
|
||||
->raw(', ')
|
||||
->subcompile($trait->getNode('template'))
|
||||
->raw(".', ")
|
||||
->raw('), ')
|
||||
->repr($node->getTemplateLine())
|
||||
->raw(", \$this->source);\n")
|
||||
->outdent()
|
||||
|
||||
Reference in New Issue
Block a user