Server has no HTTP timeouts — Slowloris risk on public endpoints #27

Open
opened 2026-05-17 23:13:08 +02:00 by heiko · 1 comment
Owner

Summary

cmd/cert-proxy-server/main.go:71 starts the server with http.Serve(listener, nil) and no http.Server struct, so ReadTimeout, WriteTimeout, and IdleTimeout are all zero (unlimited).

The endpoints /v1/cert/, /v1/chain/, and /v1/fullchain/ require no client certificate, so any anonymous TCP peer can hold connections open indefinitely (Slowloris-style).

Fix

Replace the bare http.Serve call with an explicit http.Server:

srv := &http.Server{
    ReadHeaderTimeout: 10 * time.Second,
    WriteTimeout:      30 * time.Second,
    IdleTimeout:       120 * time.Second,
}
log.Fatal(srv.Serve(listener))
## Summary `cmd/cert-proxy-server/main.go:71` starts the server with `http.Serve(listener, nil)` and no `http.Server` struct, so `ReadTimeout`, `WriteTimeout`, and `IdleTimeout` are all zero (unlimited). The endpoints `/v1/cert/`, `/v1/chain/`, and `/v1/fullchain/` require no client certificate, so any anonymous TCP peer can hold connections open indefinitely (Slowloris-style). ## Fix Replace the bare `http.Serve` call with an explicit `http.Server`: ```go srv := &http.Server{ ReadHeaderTimeout: 10 * time.Second, WriteTimeout: 30 * time.Second, IdleTimeout: 120 * time.Second, } log.Fatal(srv.Serve(listener)) ```
Author
Owner

AI attribution comment added per repository instruction for this open issue.\n\n(co)authored by ai:gpt-5-codex

AI attribution comment added per repository instruction for this open issue.\n\n(co)authored by ai:gpt-5-codex
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
heiko/cert-proxy#27
No description provided.