Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timing attack possible on Phalcon\Security::checkHash() ? #1755

Closed
moderndeveloperllc opened this issue Jan 3, 2014 · 3 comments
Closed

Comments

@moderndeveloperllc
Copy link

While doing a userland class to allow the use of scrypt hashing in Phalcon, I came across lots of talk about theoretical timing attacks on hash/encyption checking functions. The issue comes about with C function memcmp() internally used by PHP. Basically, it returns on the first non-equal byte, which can provide timing info to allow iterative guessing of the string. Other vendors have added utility functions to do constant-time string comparison. I noticed that the checkHash() function uses the is_equal_function C function. I believe that this has the same issue, but I'm not totally sure. Perhaps something to think about for 2.0?

@ghost
Copy link

ghost commented Jan 4, 2014

This was on my todo list for the past 5 months 😕

@moderndeveloperllc
Copy link
Author

Sorry, I tried to see if there was already an issue logged for this. Thanks for getting this in!

@ghost
Copy link

ghost commented Jan 6, 2014

The fix has been merged into both 1.2.5 and 1.3.0.

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

No branches or pull requests

2 participants