Skip to content

Commit

Permalink
[HttpKernel] Use constant time comparison in UriSigner
Browse files Browse the repository at this point in the history
  • Loading branch information
stof authored and nicolas-grekas committed Nov 11, 2019
1 parent 78d86f8 commit 9a50fc5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpKernel/UriSigner.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function check($uri)
$hash = urlencode($params['_hash']);
unset($params['_hash']);

return $this->computeHash($this->buildUrl($url, $params)) === $hash;
return hash_equals($this->computeHash($this->buildUrl($url, $params)), $hash);
}

private function computeHash($uri)
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/HttpKernel/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"symfony/http-foundation": "~2.7.36|~2.8.29|~3.1.6",
"symfony/debug": "^2.6.2",
"symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-php56": "~1.8",
"psr/log": "~1.0"
},
"require-dev": {
Expand Down

0 comments on commit 9a50fc5

Please sign in to comment.