Skip to content

Add HTTP server timeouts to harden webhook#20

Merged
jenting merged 1 commit into
mainfrom
fix/server-timeouts
Jun 10, 2026
Merged

Add HTTP server timeouts to harden webhook#20
jenting merged 1 commit into
mainfrom
fix/server-timeouts

Conversation

@jenting

@jenting jenting commented Jun 10, 2026

Copy link
Copy Markdown
Member

Summary

Adds explicit timeouts to the webhook http.Server:

  • ReadHeaderTimeout: 5s
  • ReadTimeout: 10s
  • WriteTimeout: 10s
  • IdleTimeout: 60s

Why

The server previously had no timeouts. This left it open to Slowloris-style attacks, where clients keep connections open by trickling bytes (e.g. never finishing the request headers), tying up goroutines until the server can no longer accept legitimate traffic. Splitting ReadHeaderTimeout from ReadTimeout lets us be strict about header reads (always small) while leaving more headroom for the request body.

Also resolves gosec G112 (missing ReadHeaderTimeout).

Testing

  • go build ./...
  • go test ./... — all pass

🤖 Generated with Claude Code

Set ReadHeaderTimeout, ReadTimeout, WriteTimeout, and IdleTimeout on the
webhook http.Server. Without them the server is vulnerable to Slowloris-style
attacks where clients hold connections open by trickling bytes, exhausting
goroutines. Also resolves gosec G112 (missing ReadHeaderTimeout).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jenting jenting merged commit 1d6687b into main Jun 10, 2026
6 checks passed
@jenting jenting deleted the fix/server-timeouts branch June 10, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant