Repository navigation
Conversation
Read complete request bodies within configurable byte budgets before any write handler decodes or mutates state. Reject declared and streamed overflow with HTTP 413, including excess bytes after a valid signed object. Preserve accepted bytes and close the original body before dispatch. Default structural requests to 64 KiB and narrative claims to 1 MiB. Expose positive deployment overrides through cloudyd flags and an explicit server constructor. Document the deployment boundary and conformance scope. Cover all ten write routes, exact boundaries, real chunked HTTP, signed registration and claims, read limits, and read/close failures. Race-enabled Go tests, build, vet, formatting and Qlty baseline comparison pass. Signed-off-by: Nirmal Khedkar <nirmalhk7@gmail.com>
Signed-off-by: Nirmal Khedkar <nirmalhk7@gmail.com>
nirmalhk7
marked this pull request as ready for review
November 11, 2026 23:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consumer JSON handlers currently decode unbounded request bodies. A valid signed object can also be accepted before its oversized trailing bytes are noticed, allowing registration or narrative storage to mutate despite an excessive request.
This change puts a shared complete-body guard before all ten consumer JSON write handlers. It rejects declared and streamed overflow with a JSON HTTP 413 response before decoding or mutation, reads at most the configured limit plus one byte for unknown lengths, and closes the original body before dispatch. Accepted bytes reach the existing decoder unchanged. Read or close failures return HTTP 400 without admitting the write.
Defaults are 64 KiB for structural requests and 1 MiB for claims carrying member-local narrative.
cloudydexposes positive-request-bytesand-claim-request-bytesoverrides; embedded callers can useNewServerWithLimits. The existingNewServersignature remains compatible and uses the defaults. The deployment guide and conformance notes explain the budgets and their scope.Validation:
go test -race ./... -count=1suite,go build ./...,go vet ./..., repository formatting, and whitespace checks pass.12cf534is SSH-signed and DCO-signed-off; its signature was verified locally.These are per-request deployment controls, not consensus or financial rules. Public reads, signed artifact formats, covenant semantics, escrow policy and
/v0/node relay traffic retain their existing contracts. Aggregate concurrency and HTTP timeouts remain separate concerns. Existing in-memory storage and ephemeral-key limitations remain; no production deployment verification is claimed.The route-registration changes share
server.gowith #31; preserve both its reference-read additions and these write guards during integration. #34 changes marketplace browsing and is not a prerequisite for this fix. This draft is ready for independent review; hosted CI and maintainer approval remain pending.