Limit keyserver JSON request bodies#40
Conversation
Add the local keyserver service, CLI publish/login/fetch commands, compose smoke wiring, and tests as a reviewable baseline for the security hardening work stacked above it. Constraint: Security fixes for issues #30-#34 target files that are not yet present on main. Rejected: Fold all security fixes into one PR | would make review and issue closure harder. Confidence: medium Scope-risk: broad Directive: Review this foundation before merging stacked hardening PRs into main. Tested: PYTHONPATH=. python3 -m unittest discover keyserver/tests; env -u GOROOT -u GOPATH /opt/homebrew/bin/go test ./... Not-tested: Docker compose smoke test was not run locally.
The keyserver now rejects oversized JSON requests before reading them into memory, reducing unauthenticated memory pressure on publish and auth endpoints. Constraint: Keep the limit simple and dependency-free for the small JSON profiles exchanged by this service. Rejected: Streaming JSON parsing | unnecessary for the current profile and auth payload sizes. Confidence: high Scope-risk: narrow Directive: Increase MAX_JSON_BODY_BYTES only with explicit profile size requirements and DoS impact review. Tested: PYTHONPATH=. python3 -m unittest discover keyserver/tests; env -u GOROOT -u GOPATH /opt/homebrew/bin/go test ./... Related: #32
There was a problem hiding this comment.
The implementation correctly adds a 64 KiB limit for JSON request bodies to prevent denial of service attacks. The size validation occurs before reading the request body, which is the proper approach for resource protection. Both PUT and POST auth endpoints handle oversized requests appropriately with 413 responses, and the test coverage validates both scenarios. No blocking issues found.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
|
Closing because this was opened against the wrong repository. The security triage is being redone against companyjupiter/quarkify. |
Summary
Closes #32.
Validation
PYTHONPATH=. python3 -m unittest discover keyserver/testsenv -u GOROOT -u GOPATH /opt/homebrew/bin/go test ./...