security: add HTTP server timeouts (ai:gpt-5) #54
Labels
No labels
nagonag
nagonag/ignore
bug
doc
duplicate
enhancement
help wanted
invalid
question
security
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
IUS/once#54
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Finding from a whole-codebase security review.
Affected code:
http.ListenAndServeTLSorhttp.ListenAndServedirectly with the default server settings.Impact:
The default
net/httpserver has noReadHeaderTimeout,ReadTimeout,WriteTimeout, orIdleTimeout. An unauthenticated client can hold connections open slowly and consume server resources, especially when Once is exposed directly or when a reverse proxy does not fully absorb slow clients.Suggested fix:
http.Serverexplicitly with conservative timeouts.Fixed by commit
f407586(Add configurable HTTP server timeouts).Implements all four timeouts:
Timeouts are configurable via TOML config. Security review confirmed proper implementation with comprehensive test coverage.