Skip to content

Commit d74cceb

Browse files
committed
Fix request authentication safe hash comparison
1 parent 6f88a19 commit d74cceb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/AppBundle/Issues/GitHubRequestHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,6 @@ private function authenticate($hash, $key, $data)
8585
throw new \RuntimeException('"hash" extension is needed to check request signature.');
8686
}
8787

88-
return $hash !== 'sha1='.hash_hmac('sha1', $data, $key);
88+
return hash_equals($hash, 'sha1='.hash_hmac('sha1', $data, $key));
8989
}
9090
}

0 commit comments

Comments
 (0)