Repository navigation
OSS-369 B-12/B-15: request/session limits and safe Geyser bind defaults - #537
Merged
Merged
Conversation
…369 B-12/B-15) B-12 binds upload sessions to their authenticated owner across init, stream, status, chunk, cancel and every consuming import/save RPC or REST route. The panel HTTP server pins MaxHeaderBytes and the shared console/RCON sender enforces command length and a bounded, pruned rate-limit window. B-15 defaults standalone Geyser to a loopback Bedrock bind with explicit address opt-in; the shipped module keeps its deliberate container-wide bind and documents migration. Verified with pinned Go 1.26.11: go build/vet ./..., full go test ./... -count=1, golangci-lint 2.13.2 --new-from-rev=origin/main (0 issues), knowledge-lint -fix then clean (71 concepts, 38/38 queries). Independent review found and verified fixes for a consume-path regression identified during review.
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.
Scope
Two isolated OSS-369 defensive-hardening slices; no other gap items touched.
B-12 — request/session limits
OwnerUserID. The generated RPC service, raw streaming upload handler and every consuming import/save endpoint (file, mod, datapack, modpack, world import, Packwiz content/datapacks) enforce that owner throughGetTempPathFor/CleanupSessionFor/CancelFor. Cross-user access returnspermission_denied(Connect) or 403 (legacy REST); legacy unowned/internal sessions keep working.http.ServerpinsMaxHeaderBytes = 1 MiB(Go's historical default) through a helper shared with loopback fixtures.command.Sendercaps commands at 4096 bytes (matching the existing WebSocket console bound) and applies a 60-per-minute sliding-window limit keyed by authenticated user, or by validated server for background jobs. Unknown server IDs create no limiter keys; idle keys are pruned above 1024 entries.B-15 — Bedrock/Geyser safe defaults
cmd/geysernow generatesbedrock.address: 127.0.0.1whenBEDROCK_ADDRESSis unset, and warns on an explicit wildcard bind. SettingBEDROCK_ADDRESSexplicitly remains the opt-in to wider binding.BEDROCK_ADDRESS=0.0.0.0because the panel UDP proxy dials the container IP; a fixture pins that contract. Existing generated configs are never rewritten unlessOVERWRITE_CONFIG=true. Migration and network-restriction guidance is indocs/deployment-modes.mdand the proxy-routing guide.Evidence
Pinned Go 1.26.11 on native Windows:
go build ./...— cleango vet ./...— cleango test ./... -count=1— all packages passgolangci-lintv2.13.2--new-from-rev=origin/main ./...— 0 issuesknowledge-lint -fix, thenknowledge-lint— 71 concepts, 38/38 fixed queries, indexes currentNegative/positive fixtures: cross-user session status/chunk/stream/cancel/cleanup refusal and owner success; real
InitUpload→stream→SaveUploadedFileRPC flow with permission denial for another user and success for the owner; wrong-owner raw streaming upload 403 and legacy unowned stream 200; oversized header 431 and ordinary header 200 on a loopback test server; oversized command refused before any transport, command at cap delivered; 61st command in a window refused and refill after window; independent user budgets; unknown-server IDs create no keys; idle-key pruning; Geyser default/override/wildcard-detection config tests; builtin template explicit wide bind preserved.Review
Independent review initially found a release-blocking regression: owner-bound sessions could not be consumed by the unowned temp-path/cleanup wrappers, and consume endpoints lacked owner enforcement. Both were fixed across all seams, covered by new fixtures, and confirmed resolved by follow-up independent review with no new defects. CI is requested here; do not merge until independent review of the final head and required CI are green.
Honest limits
CGO_ENABLED=0); concurrency claims rest on code inspection and CI race expectations.