From 48c08e3890fe507bb64d59ec8004586ced676171 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Fri, 24 Apr 2026 11:28:40 -0600 Subject: [PATCH] admin: Limit config size (by @omercnet) GitHub was giving me errors related to merge status so we are doing this instead --- admin.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/admin.go b/admin.go index a93595416..766d8506a 100644 --- a/admin.go +++ b/admin.go @@ -1063,6 +1063,9 @@ func handleConfig(w http.ResponseWriter, r *http.Request) error { buf.Reset() defer bufPool.Put(buf) + const maxConfigSize = 100 * 1024 * 1024 // 100 MB + r.Body = http.MaxBytesReader(w, r.Body, maxConfigSize) + _, err := io.Copy(buf, r.Body) if err != nil { return APIError{