MEDIUM: Unbounded request body read in webhook handler — denial of service #21
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
File:
internal/handlers/webhook.go,HandleWebhook(), line ~30Severity: MEDIUM — Denial of Service
Description
The webhook handler reads the entire request body without any size limit:
An attacker who knows (or guesses) a webhook URL can send an arbitrarily large payload, consuming all available memory and causing the process to OOM.
The webhook endpoint is unauthenticated (protected only by the secret in the URL), making this externally exploitable.
Suggested Fix
Use
io.LimitReaderto cap the body size:this is already fixed in #6