Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions system/core/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ public function xss_hash()
{
$rand = $this->get_random_bytes(16);
$this->_xss_hash = ($rand === FALSE)
? md5(uniqid(mt_rand(), TRUE))
? sha256(uniqid(mt_rand(), TRUE))
: bin2hex($rand);
}

Expand Down Expand Up @@ -1101,7 +1101,7 @@ protected function _csrf_set_hash()

$rand = $this->get_random_bytes(16);
$this->_csrf_hash = ($rand === FALSE)
? md5(uniqid(mt_rand(), TRUE))
? sha256(uniqid(mt_rand(), TRUE))
: bin2hex($rand);
}

Expand Down
6 changes: 3 additions & 3 deletions system/libraries/Session/drivers/Session_memcached_driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public function read($session_id)
$this->_session_id = $session_id;

$session_data = (string) $this->_memcached->get($this->_key_prefix.$session_id);
$this->_fingerprint = md5($session_data);
$this->_fingerprint = sha256($session_data);
return $session_data;
}

Expand Down Expand Up @@ -201,14 +201,14 @@ public function write($session_id, $session_data)
return $this->_failure;
}

$this->_fingerprint = md5('');
$this->_fingerprint = sha256('');
$this->_session_id = $session_id;
}

$key = $this->_key_prefix.$session_id;

$this->_memcached->replace($this->_lock_key, time(), 300);
if ($this->_fingerprint !== ($fingerprint = md5($session_data)))
if ($this->_fingerprint !== ($fingerprint = sha256($session_data)))
{
if ($this->_memcached->set($key, $session_data, $this->_config['expiration']))
{
Expand Down
4 changes: 2 additions & 2 deletions system/libraries/Session/drivers/Session_redis_driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public function read($session_id)
? $this->_key_exists = TRUE
: $session_data = '';

$this->_fingerprint = md5($session_data);
$this->_fingerprint = sha256($session_data);
return $session_data;
}

Expand Down Expand Up @@ -259,7 +259,7 @@ public function write($session_id, $session_data)
}

$this->_redis->{$this->_setTimeout_name}($this->_lock_key, 300);
if ($this->_fingerprint !== ($fingerprint = md5($session_data)) OR $this->_key_exists === FALSE)
if ($this->_fingerprint !== ($fingerprint = sha256($session_data)) OR $this->_key_exists === FALSE)
{
if ($this->_redis->set($this->_key_prefix.$session_id, $session_data, $this->_config['expiration']))
{
Expand Down