fix: Harden GitHub webhook endpoint against large-body DoS and unauthenticated flood traffic - #197
Merged
JSONbored merged 4 commits intoJun 1, 2026
Conversation
jonathanchang31
force-pushed
the
fix/unauthenticated-github-webhook
branch
from
June 1, 2026 17:18
d696d68 to
223d3a6
Compare
Contributor
Author
|
@JSONbored Could you review my PR? |
JSONbored
approved these changes
Jun 1, 2026
JSONbored
left a comment
Owner
There was a problem hiding this comment.
@jonathanchang31 This is ready from my side. This is the earlier viable webhook hardening PR, current checks are green, and the merge tree is clean.
A few notes:
- It covers webhook body-size limits plus stricter webhook rate-limit handling.
- Integration and webhook unit tests cover the protected paths.
- Under the duplicate-submission policy, this should be preferred over the later overlapping webhook-body-only PR unless a specific superseding reason is identified.
2 tasks
4 tasks
loopover-orb Bot
added a commit
that referenced
this pull request
Jul 26, 2026
…8940) handleGitHubWebhook rejects an oversized request via a content-length header check (413 fast-path) before touching the body (#197). handleOrbRelay, processing the identical GitHub payload shape, went straight to readBodyWithLimit — enforcing the cap only after buffering up to it. Add the same content-length pre-check so an oversized relay request is rejected at the header stage, matching handleGitHubWebhook's DoS-hardening pattern exactly. Closes #8888 Co-authored-by: RealDiligent <brave.challenge007@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: loopover-orb[bot] <296761690+loopover-orb[bot]@users.noreply.github.com>
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.
Summary
This change fixes issue #196 by protecting
/v1/github/webhookwith:413 Payload Too LargeThe endpoint now rejects abusive webhook traffic earlier and more predictably while preserving normal signed webhook behavior.
Related Issue
Fixes: #196
Change Type
Real Behavior Proof
1) Oversized payload is rejected
Request: 50MB body to
/v1/github/webhookObserved:
HTTP 413{"error":"payload_too_large","maxBytes":1048576}2) Flood traffic is throttled
Repeated invalid-signature webhook requests observed:
401 Unauthorized429 Too Many Requests3) Service remains healthy
GET /healthreturned200 OKduring/after webhook abuse replay.Security Impact
Checklist