Skip to content

fix(github-issue-bot): reject webhooks with missing signature header - #500

Open
sundeep8967 wants to merge 1 commit into
appwrite:mainfrom
sundeep8967:fix/github-webhook-missing-signature-350
Open

sundeep8967 wants to merge 1 commit into
appwrite:mainfrom
sundeep8967:fix/github-webhook-missing-signature-350

Conversation

@sundeep8967

Copy link
Copy Markdown

Problem

In both the JavaScript (node/github-issue-bot) and TypeScript (node-typescript/github-issue-bot) templates, verifyWebhook(req) checked:

return (
  typeof signature !== 'string' ||
  (await verify(process.env.GITHUB_WEBHOOK_SECRET, req.bodyBinary, signature))
);

When the x-hub-signature-256 header is omitted or missing, signature is undefined. As a result, typeof signature !== 'string' evaluated to true, prematurely returning true and treating unsigned / unauthenticated webhook requests as valid.

Fixes #350

Solution

  1. In node/github-issue-bot/src/github.js, check if typeof signature !== 'string' and return false immediately.
  2. In node-typescript/github-issue-bot/src/github.ts, apply the identical guard returning false if the signature header is missing or non-string.
  3. Cryptographically verify the payload against GITHUB_WEBHOOK_SECRET when the signature is provided.

Testing

  • Verified boolean logic: missing or undefined signature header returns false as expected.
  • Verified valid signature verification delegates to @octokit/webhooks-methods verify.
  • Clean diff with zero extraneous changes.

@appwrite

appwrite Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Code review

Commit Status Tier Verdict Details
32fa8df Reviewed Reviewed 🟢 S · Ready to merge 💬 Commented View review

The missing-signature bypass is closed in both templates, and the verified-signature path remains unchanged.

Both GitHub issue bot templates now reject webhook requests when the x-hub-signature-256 header is absent or not a string. Requests with a string signature continue through cryptographic verification against the configured secret.

Note

@sundeep8967 does not have write access to this repository, so Hansi does not approve automatically. A maintainer can review and approve.

Walkthrough (2)
File Change
node/github-issue-bot/src/github.js Adds an early rejection for missing or non-string webhook signatures before cryptographic verification.
node-typescript/github-issue-bot/src/github.ts Applies the same signature guard and verification flow in the TypeScript template.

Reviewed 32fa8df

Tip

Comment @appwrite review to re-run, or mention @appwrite with a question.

@appwrite appwrite Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Tier S · Looks good to merge. Summary

- 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
sundeep8967 force-pushed the fix/github-webhook-missing-signature-350 branch from 616ca24 to 32fa8df Compare November 27, 2026 12: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.

Authentication Bypass in GitHub Webhook Verification via Missing X-Hub-Signature-256 Header

1 participant