devbox/internal/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
..
blobstore harden(durability): fsync atomic writes before publishing the rename 💽 2026-06-23 02:59:26 -05:00
meta fix(dataloss): make hub GC safe against cross-share refcount undercount 🩸🗑️ 2026-06-23 02:35:43 -05:00
blob_traversal_test.go fix(sec): block blob-hash path traversal (arbitrary file read) 🔓🛡️ 2026-06-23 02:21:03 -05:00
events.go feat(M3): live two-way sync — SSE fan-out + daemon + mount 🔄 2026-06-23 00:12:39 -05:00
limits_test.go harden(dos): bound request bodies + add hub server timeouts 🚪🛡️ 2026-06-23 02:59:53 -05:00
server.go harden(dos): bound request bodies + add hub server timeouts 🚪🛡️ 2026-06-23 02:59:53 -05:00
server_test.go feat(M6): versioning — log, restore, hub gc 🕰️ 2026-06-23 01:01:54 -05:00
sharename.go fix(M7): review fixes — pidfile O_EXCL, publish race, backoff reset 🐛 2026-06-23 01:37:58 -05:00
sharename_test.go fix(M7): review fixes — pidfile O_EXCL, publish race, backoff reset 🐛 2026-06-23 01:37:58 -05:00