Repository navigation
Conversation
Client.request buffered Studio API bodies with an unbounded io.ReadAll. A misbehaving or compromised endpoint could exhaust the CLI before JSON validation ran. Cap the accepted body at 64 MiB and fail with a clear error once the limit is exceeded. Fixes apache#4640
Contributor
Author
|
Keep-alive: rebased state unchanged and the fix is still current against master. Ready for review when a maintainer has time. |
1 similar comment
Contributor
Author
|
Keep-alive: rebased state unchanged and the fix is still current against master. Ready for review when a maintainer has time. |
Open
4 tasks done
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.
Which Issue(s) This PR Fixes
Brief Description
Client.requestinrmqctl/internal/studio/client.goread the Studio API response body with an unboundedio.ReadAll. Every Studio response is a small JSON envelope, so nothing justified buffering an arbitrary stream before validation.maxResponseBytes) and read throughio.LimitReader.studio response exceeds N byteserror once the cap is exceeded.Clientso tests can inject a small value without changing production defaults.How Did You Test This Change?
All existing studio tests plus the new cases pass:
TestReadBounded— accepts a body at the limit, rejects one byte overTestRequestRejectsOversizedStudioResponse—Client.requestreturns the size-cap errorTestRequestAcceptsNormalStudioEnvelope— normal small envelopes still decodeChecklist
feat:/fix:/refactor:/chore:/docs:/perf:)...Testweb/src/i18n/(N/A — CLI only)mvn testruns the ArchUnit checks) (N/A — Go-only change; no Java)docs// in-app help) (N/A — internal client bound)