Skip to content
Browse files

XSS: Escaped values for hidden fields in the forms parsed by the temp…

…late-engine.
  • Loading branch information...
1 parent bdeb2c4 commit 9127077c8df255aaab487e54f914858763947180 @tijsverkoyen tijsverkoyen committed
Showing with 4 additions and 4 deletions.
  1. +2 −2 CHANGELOG.md
  2. +2 −2 library/spoon/template/compiler.php
View
4 CHANGELOG.md
@@ -3,8 +3,8 @@
Bugfixes:
-* XSS: Escape the input on ajax searches.
-* XSS: Escaped wierd input in Locale-module
+* Core: Escape the input on ajax searches.
+* Core: Escaped wierd input in Locale-module
3.3.0 (2012-03-06)
View
4 library/spoon/template/compiler.php
@@ -365,7 +365,7 @@ protected function parseForms($content)
<?php echo $this->forms[\'' . $name . '\']->getField(\'form\')->parse();
if($this->forms[\'' . $name . '\']->getUseToken())
{
- ?><input type="hidden" name="form_token" id="<?php echo $this->forms[\'' . $name . '\']->getField(\'form_token\')->getAttribute(\'id\'); ?>" value="<?php echo $this->forms[\'' . $name . '\']->getField(\'form_token\')->getValue(); ?>" />
+ ?><input type="hidden" name="form_token" id="<?php echo $this->forms[\'' . $name . '\']->getField(\'form_token\')->getAttribute(\'id\'); ?>" value="<?php echo htmlspecialchars($this->forms[\'' . $name . '\']->getField(\'form_token\')->getValue()); ?>" />
<?php } ?>';
}
@@ -379,7 +379,7 @@ protected function parseForms($content)
<?php echo $this->forms[\'' . $name . '\']->getField(\'form\')->parse();
if($this->forms[\'' . $name . '\']->getUseToken())
{
- ?><input type="hidden" name="form_token" id="<?php echo $this->forms[\'' . $name . '\']->getField(\'form_token\')->getAttribute(\'id\'); ?>" value="<?php echo $this->forms[\'' . $name . '\']->getField(\'form_token\')->getValue(); ?>" />
+ ?><input type="hidden" name="form_token" id="<?php echo $this->forms[\'' . $name . '\']->getField(\'form_token\')->getAttribute(\'id\'); ?>" value="<?php echo htmlentities($this->forms[\'' . $name . '\']->getField(\'form_token\')->getValue()); ?>" />
<?php } ?>';
}

0 comments on commit 9127077

Please sign in to comment.
Something went wrong with that request. Please try again.