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

Fix webhook signature validation #568

Merged
merged 2 commits into from
Feb 8, 2021
Merged

Conversation

swfree
Copy link
Contributor

@swfree swfree commented Feb 6, 2021

Issue Link 🔗

Implementation Details 🚧

  • PHP's json_encode method escapes slashes & multibyte Unicode characters by default, whereas Node's JSON.parse and JSON.stringify methods do not. This change translates the parsed JSON body back into a string that will correctly match the original body used to compute the webhook signature.

@coveralls
Copy link
Collaborator

coveralls commented Feb 6, 2021

Pull Request Test Coverage Report for Build 2764

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.001%) to 96.963%

Totals Coverage Status
Change from base Build 2751: 0.001%
Covered Lines: 2356
Relevant Lines: 2394

💛 - Coveralls

sujaygarlanka
sujaygarlanka previously approved these changes Feb 8, 2021
@swfree swfree merged commit f603481 into master Feb 8, 2021
@swfree swfree deleted the fix-webhook-validate-signature branch February 8, 2021 22:28
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.

Passing the body as an Object to validateWebhookMessage is not reliable
3 participants