Skip to content

Commit b49245d

Browse files
committed
Use constant time comparison in UriSigner
1 parent 27185ca commit b49245d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

UriSigner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function check($uri)
7979
$hash = $params[$this->parameter];
8080
unset($params[$this->parameter]);
8181

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

8585
private function computeHash($uri)

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"symfony/http-foundation": "~3.4.12|~4.0.12|^4.1.1",
2222
"symfony/debug": "^3.3.3|~4.0",
2323
"symfony/polyfill-ctype": "~1.8",
24+
"symfony/polyfill-php56": "~1.8",
2425
"psr/log": "~1.0"
2526
},
2627
"require-dev": {

0 commit comments

Comments
 (0)