Skip to content

[PHP] Handle Badly Formatted Signatures #1942

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

Merged
merged 2 commits into from
Jun 19, 2025
Merged

Conversation

rodnaph
Copy link
Contributor

@rodnaph rodnaph commented Jun 19, 2025

Currently a notice will be thrown because of the invalid array access after splitting the signature. Would an exception be better here? signalling unexpected data from svix?

Motivation

I ran into this while testing Svix integration in our app, and throwing random test data at it. I understand this data should come from Svix, but it seems like it should be handled gracefully anyway.

Solution

If the signature in the header doesn't at least appear well formatted, skip it.

currently a notice will be thrown because of the invalid array access
after splitting the signature.

would an exception be better here? signalling unexpected data from svix?
@rodnaph rodnaph requested a review from a team as a code owner June 19, 2025 08:27
@rodnaph rodnaph changed the title Handle Badly Formatted Signatures [PHP] Handle Badly Formatted Signatures Jun 19, 2025
tasn
tasn previously approved these changes Jun 19, 2025
Copy link
Member

@tasn tasn left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

@tasn tasn merged commit ff28c89 into svix:main Jun 19, 2025
9 checks passed
@svix-mman svix-mman mentioned this pull request Jun 25, 2025
svix-mman added a commit that referenced this pull request Jun 25, 2025
## Version 1.68.0
* Server: Ensure messagecontent expiration is set
* Libs/PHP: Handle Badly Formatted Signatures by @rodnaph in
#1942
* Libs/All: Automatically send an idempotency key on all outgoing post
requests

## New Contributors
* @rodnaph made their first contribution in
#1942
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.

3 participants