Repository navigation
fix(github-issue-bot): reject webhooks with missing signature header - #500
Open
sundeep8967 wants to merge 1 commit into
Open
sundeep8967 wants to merge 1 commit into
sundeep8967 wants to merge 1 commit into
Conversation
Code review
Both GitHub issue bot templates now reject webhook requests when the Note @sundeep8967 does not have write access to this repository, so Hansi does not approve automatically. A maintainer can review and approve. Walkthrough (2)
Reviewed Tip Comment |
- Fixes appwrite#350 - Previously, 'typeof signature !== string' evaluated to true when the header was missing or undefined, inadvertently bypassing webhook signature verification. - Return false when the x-hub-signature-256 header is missing or non-string. Signed-off-by: sundeep8967 <sundeep8967@gmail.com>
sundeep8967
force-pushed
the
fix/github-webhook-missing-signature-350
branch
from
November 27, 2026 12:28
616ca24 to
32fa8df
Compare
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.

Problem
In both the JavaScript (
node/github-issue-bot) and TypeScript (node-typescript/github-issue-bot) templates,verifyWebhook(req)checked:When the
x-hub-signature-256header is omitted or missing,signatureisundefined. As a result,typeof signature !== 'string'evaluated totrue, prematurely returningtrueand treating unsigned / unauthenticated webhook requests as valid.Fixes #350
Solution
node/github-issue-bot/src/github.js, check iftypeof signature !== 'string'and returnfalseimmediately.node-typescript/github-issue-bot/src/github.ts, apply the identical guard returningfalseif the signature header is missing or non-string.GITHUB_WEBHOOK_SECRETwhen the signature is provided.Testing
falseas expected.@octokit/webhooks-methodsverify.