Skip to content

[Security] Use hash_equals when available for constant-time string comparison #11795

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

Closed
wants to merge 1 commit into from

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented Aug 28, 2014

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

Use the hash_equals function (introduced in PHP 5.6) for timing attack safe string comparison when available.

@fabpot
Copy link
Member

fabpot commented Aug 29, 2014

should probably be done in 2.3, no?

@fabpot
Copy link
Member

fabpot commented Aug 29, 2014

👍

@pborreli
Copy link
Contributor

agree with @fabpot for merging it in 2.3 as it's a security improvement and should not break BC.

@dunglas
Copy link
Member Author

dunglas commented Aug 29, 2014

+1 for 2.3. I recreate a PR.

@stof
Copy link
Member

stof commented Aug 29, 2014

@dunglas Recreating the PR is not needed most of the time. We can rebase the branch automatically when merging if it applies cleanly

@stof
Copy link
Member

stof commented Aug 29, 2014

@pborreli it is not really a security improvement. It simply relies on the constant-time comparison implemented in C when available rather than using the PHP implementation

@dunglas dunglas deleted the hash_equals branch December 5, 2015 09:01
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

Successfully merging this pull request may close these issues.

4 participants