Repository navigation
Add error messages to help users debug signature verification failures - #1995
Merged
Merged
Conversation
The stripe-signature header may now include additional metadata about the event destination and the event being sent. These can help narrow down the reason why signature verification failed. No changes are made to the verification process; this just updates how error messages are generated, if the metadata is present in the header.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unauthenticated metadata can currently produce misleading or injected diagnostic messages.
1 open finding
What changed in this PR
Adds webhook signature-failure diagnostics using metadata from the Stripe-Signature header.
Changes:
- Diagnoses signing-secret and payload mismatches.
- Validates and extracts diagnostic metadata.
- Adds tests and a patch changefile.
| File | Description |
|---|---|
lib/stripe/webhook.rb |
Generates detailed verification errors. |
test/stripe/webhook_test.rb |
Tests diagnostic behavior. |
test/test_helper.rb |
Supports metadata in test headers. |
.hark/changes/2026-10-12_orrc_webhook-signature-diagnostics.change.md |
Documents the user-facing change. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
jar-stripe
reviewed
Oct 14, 2026
jar-stripe
approved these changes
Oct 28, 2026
mark-kogan-stripe
enabled auto-merge (squash)
November 9, 2026 18:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Why?
Webhook signature verification failures are often caused by using the wrong signing secret, or modifying the payload before passing it into the verification function. However, we're currently unable to provide developers with any hints as to why verification is failing.
What?
The
stripe-signatureHTTP header sent with each event will start to include metadata about the event destination and the event payload.This update uses that metadata, when present, to provide more detailed error messages in the case of signature verification failures. These can help developers narrow down what might be wrong with their code or configuration.
No changes are made to the actual signature verification process; this just updates how error messages are generated.
See Also
https://go/j/TSE-2678
https://go/j/SECREV-5921
Configuration
skip-changefile: This PR is not a user-facing change, so there's no changefile.