devbox/cmd/devbox-hub
shoemoney fd361e811e harden(dos): bound request bodies + add hub server timeouts 🚪🛡️
The hub read request bodies with unbounded io.ReadAll / json.Decode and ran
http.ListenAndServe with zero timeouts — a single client could OOM it or hold
connections open (slowloris). Now:
- handleBlob caps the body at 256 MiB, decode() caps JSON at 8 MiB, both via
  http.MaxBytesReader -> 413 when exceeded.
- serve uses an http.Server with ReadHeaderTimeout/ReadTimeout/IdleTimeout +
  MaxHeaderBytes. WriteTimeout intentionally unset so the long-lived /v1/events
  SSE stream isn't killed. [fanned-out subagent: harden-dos]
2026-06-23 02:59:53 -05:00
..
gc_crossshare_test.go fix(dataloss): make hub GC safe against cross-share refcount undercount 🩸🗑️ 2026-06-23 02:35:43 -05:00
gc_test.go feat(M6): versioning — log, restore, hub gc 🕰️ 2026-06-23 01:01:54 -05:00
main.go harden(dos): bound request bodies + add hub server timeouts 🚪🛡️ 2026-06-23 02:59:53 -05:00