From 033911c2708955aec2e8ada866929e39db16493b Mon Sep 17 00:00:00 2001 From: Dave Protasowski Date: Fri, 29 May 2026 12:19:47 -0400 Subject: [PATCH] Limit the webhook request body size to 3MiB --- webhook/webhook.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webhook/webhook.go b/webhook/webhook.go index e8895db75e..b8ff962e56 100644 --- a/webhook/webhook.go +++ b/webhook/webhook.go @@ -394,5 +394,7 @@ func (wh *Webhook) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } - wh.mux.ServeHTTP(w, r) + const MaxBodySize = 3 * 1024 * 1024 // 3 MiB + h := http.MaxBytesHandler(&wh.mux, MaxBodySize) + h.ServeHTTP(w, r) }