fix: verify GitHub webhooks using raw request body - #51
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
* Feature/remove convex log store (#46) * refactor: remove redundant Convex log storage * chore: remove internal development plan * feat: add CI checks and refresh Convex tooling Remove keepalive workflow and obsolete task logging backend while adding formatting, linting, typechecking, build scripts, and expanded Convex agent skills. * fix: add ESLint dependencies and Convex log reference * feat: remove obsolete task API and log parameter * fix: convex client usage for live updates * fix: use Live Updates for Cleanup Recovery * fix: remove unused Convex API routes * feat: add DaemonDoc development and migration plan Add `daemondoc-plan.md` outlining current blockers, the v1 patch strategy, and the full v2 rewrite roadmap to transition from the current setup to a GitHub App-based architecture. * fix: fix README cleanup bypasses the queue runs inline in the HTTP (#48) request Implement reactive README cleanup progress UI Replace the static cleanup progress toast with a reactive system driven by Convex log messages. Added `cleanup-queue` worker support and logic to handle job retries and recovery via `sharedLogId`. * Fix/flag abandoned mid refactor (#49) * fix: prevent duplicate ActiveRepo records on reactivation * fix: refactor imports and resolve lint issues * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * fix: update repo activity sync and fix deactivation logic * fix: verify GitHub webhooks using raw request body (#51) * Refactor LLM service and add full mode pipeline (#52) * refactor: introduce LLM service orchestration layer * feat: add full mode pipeline * fix: pass AI SDK options directly to generateText * refactor: remove legacy LLM service layer * Improve repository scanning and LLM generation updates (#53) * Improve repository scanning and LLM generation updates * Format LLM and Git utility code consistently * Replace OpenAI SDK with AI Google provider * Cleanup/cleanup llm refactor code (#54) * fix: improve README generation and cleanup flow * fix: increase Gemini context and output limits * Remove obsolete README cleanup service --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This pull request refactors how the GitHub webhook handler is registered and how webhook payloads are processed and verified. The main improvements are stricter payload handling for security, moving the webhook handler route to a dedicated endpoint, and ensuring signature verification is robust.
Webhook payload handling and security:
verifyGithubSignaturefunction now strictly requiresreq.bodyto be aBufferand compares the signature and digest using timing-safe equality, reducing the risk of signature spoofing.BufferusingtoString("utf8"), ensuring consistent and secure handling of incoming data.Route registration and organization:
githubWebhookHandler) is now registered directly inindex.jsat the endpoint/api/github/webhookhandlerwithexpress.raw({ type: "application/json" }), ensuring the payload is passed as a raw buffer for signature verification. [1] [2]github.routes.js, centralizing its registration and avoiding conflicts with JSON body parsing middleware.These changes improve the security and reliability of GitHub webhook processing in the application.