fix: reject a webhook secret below the server's 16-character floor - #43
Merged
Conversation
The server enforces the floor at registration, so a short secret failed as a raw 400 mid-activation without naming the field. Validate the length up front wherever a secret reaches the server: the trigger's create hook and the action node's Webhook Create and Update. The verification path is unchanged, so webhooks registered with a legacy short secret keep verifying until re-registered.
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.
What
The server enforces a 16-character floor on webhook secrets at registration (0.20.0+). The node forwarded the secret verbatim, so a short one failed as a raw 400 in the middle of a workflow activation, with nothing pointing at the field that caused it.
This adds the same up-front validation the node already applies to empty event lists and blank path parameters, in the three places a secret reaches the server:
All three now fail with
Webhook secret must be at least 16 charactersbefore any request is sent. The field descriptions and the README state the floor and the server version it gates on.Deliberately unchanged
Tests
Three new cases cover the guards (trigger create, action create, action update) and assert no HTTP call is made when one trips; existing fixtures that registered short secrets were moved past the floor. Full suite: 299 passing.