Skip to content

Commit dd3c437

Browse files
committed
security #40 Fix request authentication safe hash comparison (sstok)
This PR was merged into the master branch. Discussion ---------- Fix request authentication safe hash comparison |Q |A | |--- |---| |Bug Fix? |yes| |New Feature? |no | |BC Breaks? |no | |Deprecations?|no | |Tests Pass? |yes| |Fixed Tickets| | |License |MIT| Commits ------- d74cceb Fix request authentication safe hash comparison
2 parents 7eee78c + d74cceb commit dd3c437

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
@@ -90,6 +90,6 @@ private function authenticate($hash, $key, $data)
9090
throw new \RuntimeException('"hash" extension is needed to check request signature.');
9191
}
9292

93-
return $hash !== 'sha1='.hash_hmac('sha1', $data, $key);
93+
return hash_equals($hash, 'sha1='.hash_hmac('sha1', $data, $key));
9494
}
9595
}

0 commit comments

Comments
 (0)