Reject truncated Thrift containers before allocation - #18631
Open
HTHou wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The implementation consistently applies the validated limit and includes focused regression coverage.
Pull request overview
Adds configurable server-side Thrift container decoding limits to reduce resource-exhaustion risk.
Changes:
- Adds a validated 100,000-element default limit.
- Applies the limit to binary and compact Thrift protocols.
- Adds configuration entries and regression coverage.
File summaries
| File | Description |
|---|---|
RpcUtils.java |
Defines the default limit. |
CommonConfig.java |
Stores and normalizes the setting. |
CommonDescriptor.java |
Loads the configuration property. |
AbstractThriftServiceThread.java |
Applies the limit to protocol factories. |
AbstractThriftServiceThreadTest.java |
Tests both protocol encodings. |
iotdb-system.properties.template |
Documents the setting. |
iotdb-system.properties |
Adds the standard default. |
edge/iotdb-system.properties |
Adds the Edge default. |
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
HTHou
marked this pull request as draft
September 14, 2026 03:26
HTHou
marked this pull request as ready for review
September 14, 2026 03:28
HTHou
marked this pull request as draft
September 14, 2026 04:41
HTHou
marked this pull request as ready for review
September 14, 2026 05:37
jt2594838
approved these changes
Sep 14, 2026
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.
Purpose
Reject malformed Thrift RPC frames that declare a container requiring more bytes than remain in the current frame, before generated code allocates the container.
Changes
TElasticFramedTransportframe.thrift_container_length_limitconfiguration and the broad protocol-level container limit.Compatibility
This does not impose a fixed element-count limit. Valid containers remain subject to the existing maximum frame size, while malformed/truncated frames are rejected before their declared container size can trigger an oversized allocation. A malformed frame causes the transport connection to close, consistent with existing frame-protection errors.
Tests
mvn -o test -pl iotdb-client/service-rpc -am -Dtest=TElasticFramedTransportReadTest,TElasticFramedTransportTest -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=falsemvn -o test-compile -DskipTestsmvn -o test-compile -P with-zh-locale -DskipTests