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

Use compare_digest in Python when comparing hex digests #196

Merged
merged 1 commit into from
Dec 1, 2016

Conversation

starpogi
Copy link
Contributor

@starpogi starpogi commented Jun 16, 2016

Doing a == comparison for hex digests could lead to timing attack vulnerabilities. By using Python's compare_digest, it would do a constant-time check by using byte operations. A timing attack on that would only reveal the length of the hashes, and not the values.

More here: https://codahale.com/a-lesson-in-timing-attacks/

  • Ruby and PHP sample codes have to be updated too. I just don't know if there is a built-in library that does constant-time comparison correctly in those languages.

@starpogi
Copy link
Contributor Author

starpogi commented Jun 16, 2016

Adding @dideler. Turns out this issue was raised last year.
#133

@dideler
Copy link
Contributor

dideler commented Jun 16, 2016

LGTM

@pirogoeth
Copy link
Contributor

Thanks!

@pirogoeth pirogoeth merged commit e8b9270 into mailgun:master Dec 1, 2016
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.

None yet

3 participants