fix(server): cap request bodies and import decompression #35
No reviewers
Labels
No labels
adr
android
area/calendar
area/design-system
area/i18n
area/jobs
area/offline
area/server
area/testing
bug
ci
duplicate
enhancement
help wanted
invalid
notifications
question
reliability
security
severity/low
severity/medium
tracking
web
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
eagraiclainne/app!35
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/request-body-caps"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stacked on #30 (
fix/setup-window).Request caps: no
WithReadMaxBytesexisted anywhere — an unauthenticated POST to Login with a huge body was a pre-auth memory-exhaustion vector. Survey showed the only large legitimate REQUEST is ImportData's archive (single-digit-MiB gzipped at family scale). Eleven services now cap at 4 MiB; SystemService alone gets 64 MiB.http.MaxBytesHandler(65 MiB) wraps the mux as a transport-level backstop covering/mcp, which is not a Connect handler.Import decompression:
maxImportBytes1 GiB → 128 MiB (the pod limit is 256Mi; the comment itself said archives are megabytes). LimitReader enforcement unchanged; a ~130 KiB bomb expanding to 129 MiB refuses with the existing named error.Tests mount the real
server.Handler: oversized Login →ResourceExhausted; 8 MiB import passes the size gate; 64 MiB+1 KiB import refused; normal traffic untouched. Integration suite (export/import round-trips, MCP) passes.Fixes #11
🤖 Generated with Claude Code
ec7ab4c82b00ce6ffa5b