Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

Security issue #4

Open
heloufir opened this issue Apr 21, 2019 · 0 comments
Open

Security issue #4

heloufir opened this issue Apr 21, 2019 · 0 comments

Comments

@heloufir
Copy link
Owner

heloufir commented Apr 21, 2019

Hello,

I came across your simple-passport package in the laravel-news community links. I came across a small security issue while reviewing the code. In the following two places it’s possible for an attacker to use a timing attack because the token comparison is not done in constant time. This article has some great background info on how timing attacks work. To mitigate this risk you can use the hash_equals function instead.

if ($user->simpleTokens == null || $user->simpleTokens->token != $token) {

https://github.com/heloufir/simple-passport/blob/1.5.2/src/Helpers/TokenHandler.php#L29

Big thanks to Matthew Allan ([email protected])

  • Matt
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant