Severity: Medium
Component: Webhook Interceptor (server/auth/webhook)
Vulnerability Type: Denial of Service (DoS)
The Webhook Interceptor loads the entire request body into memory before authenticating the request or verifying its signature. This occurs on the /api/v1/events/ endpoint, which is publicly accessible (albeit intended for webhooks). An attacker can send a request with an extremely large body (e.g., multiple gigabytes), causing the Argo Server to allocate excessive memory, potentially leading to an Out-Of-Memory (OOM) crash and denial of service.
In server/auth/webhook/interceptor.go:
func (i *WebhookInterceptor) addWebhookAuthorization(r *http.Request, kube kubernetes.Interface) error {
// ... basic checks ...
// Vulnerability: Reads entire body into memory unconditionally
buf, _ := io.ReadAll(r.Body)
defer func() { r.Body = io.NopCloser(bytes.NewBuffer(buf)) }()
// ... subsequent logic finds correct service account and secret ...
// ... verification happens later ...
}
The io.ReadAll call happens before the signature verification loop.
POST /api/v1/events/some-namespaceContent-Length: 1000000000 (1GB) header.http.MaxBytesReader.3.7.144.0.5Exploitability
AV:NAC:LAT:PPR:NUI:NVulnerable System
VC:NVI:NVA:HSubsequent System
SC:NSI:NSA:N8.2/CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N