You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The validating and mutating webhook middlewares both called io.ReadAll
on the inbound HTTP request body with no size cap before forwarding to
the configured webhook server. The client side correctly limited the
response body via io.LimitReader to MaxResponseSize, but the server
side missed the symmetric limit on inbound requests, so the webhook
package would buffer arbitrarily large bodies into memory.
Wrap r.Body with http.MaxBytesReader at MaxRequestSize (1 MB, symmetric
to MaxResponseSize) and return HTTP 413 with a JSON-RPC error envelope
when the limit is exceeded. Reject the read before any forwarding.
Note: this is the webhook-layer cap. mcp.ParsingMiddleware sits earlier
in the proxy chain and currently reads the body unbounded; capping
inbound bodies at the MCP parsing layer is tracked separately and is
the load-bearing fix against upstream DoS. This change still bounds
the webhook package's own re-read buffer and lays the symmetry
groundwork.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments