Skip to content

Commit

Permalink
Fixed highly critical security issue on cookie driver
Browse files Browse the repository at this point in the history
  • Loading branch information
Geolim4 committed Jan 24, 2017
1 parent 7ddf1bb commit 82a84ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/phpFastCache/Drivers/cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function driver_set($keyword, $value = '', $time = 300, $option = array()
{
$this->connectServer();
$keyword = 'phpFastCache_' . $keyword;
$v = $this->encode($value);
$v = json_encode($value);
if(isset($this->config['limited_memory_each_object'])
&& strlen($v) > $this->config['limited_memory_each_object']) {
return false;
Expand All @@ -92,7 +92,7 @@ public function driver_get($keyword, $option = array())
// return null if no caching
// return value if in caching
$keyword = 'phpFastCache_' . $keyword;
$x = isset($_COOKIE[ $keyword ]) ? $this->decode($_COOKIE[ $keyword ]) : false;
$x = isset($_COOKIE[ $keyword ]) ? json_decode($_COOKIE[ $keyword ]) : false;
if ($x == false) {
return null;
} else {
Expand Down

0 comments on commit 82a84ad

Please sign in to comment.