Bug: Webhook endpoint reads request body without size limit (DoS vector) #1

Closed
opened 2026-02-08 21:01:04 +01:00 by clawbot · 0 comments
Collaborator

Description

In internal/handlers/webhook.go, HandleWebhook() uses io.ReadAll(request.Body) with no size limit. An attacker who knows (or guesses) a webhook secret can send an arbitrarily large payload to exhaust server memory.

Impact

Denial of service - a single HTTP request with a multi-gigabyte body will consume all available memory.

Location

internal/handlers/webhook.go:31 - body, readErr := io.ReadAll(request.Body)

Fix

Use io.LimitReader to cap the request body at a reasonable size (e.g., 1MB).

## Description In `internal/handlers/webhook.go`, `HandleWebhook()` uses `io.ReadAll(request.Body)` with no size limit. An attacker who knows (or guesses) a webhook secret can send an arbitrarily large payload to exhaust server memory. ## Impact Denial of service - a single HTTP request with a multi-gigabyte body will consume all available memory. ## Location `internal/handlers/webhook.go:31` - `body, readErr := io.ReadAll(request.Body)` ## Fix Use `io.LimitReader` to cap the request body at a reasonable size (e.g., 1MB).
sneak closed this issue 2026-02-16 05:56:14 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sneak/upaas#1
No description provided.