Summary
Add input validation and request size limits to prevent abuse and resource exhaustion.
Current State
- Max upload size is configurable (
-max-upload, default 100MB)
- No request body size limit on non-upload endpoints
- No validation on filenames, paths, or query parameters for path traversal
- No timeout on request reads
Tasks
Why
Without input validation and timeouts, the server is vulnerable to slowloris attacks, resource exhaustion, and path traversal exploits.
Summary
Add input validation and request size limits to prevent abuse and resource exhaustion.
Current State
-max-upload, default 100MB)Tasks
http.MaxBytesReaderon all non-upload endpoints (e.g., 1MB for API requests)http.Server(e.g., 30s read, 60s write)../)http.Server.MaxHeaderBytesWhy
Without input validation and timeouts, the server is vulnerable to slowloris attacks, resource exhaustion, and path traversal exploits.