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 absolute value when checking timestamp tolerance #658

Merged
merged 1 commit into from
May 20, 2019
Merged

Conversation

ob-stripe
Copy link
Contributor

r? @brandur-stripe
cc @stripe/api-libraries

Use absolute value when checking timestamp tolerance, since the local clock may be running either early or late compared to Stripe's clock.

Fixes #657.

Also, I've moved the signature check to happen before the event deserialization -- not much point deserializing the event if we're going to throw an exception afterwards.

Copy link
Contributor

@brandur-stripe brandur-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! (And happy this was reported — it probably should've been obvious, but often when thinking about time, things are not.)

Also, I've moved the signature check to happen before the event deserialization -- not much point deserializing the event if we're going to throw an exception afterwards.

Haha, good point. +1.

@ob-stripe ob-stripe merged commit 6cec639 into master May 20, 2019
@ob-stripe ob-stripe deleted the ob-fix-657 branch May 20, 2019 18:38
@ob-stripe
Copy link
Contributor Author

Thanks Brandur!

Released as 6.35.1.

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

Successfully merging this pull request may close these issues.

Why is timestamp tolerance check in WebhookSignature one-sided?
3 participants