[Enhancement] Add structural limits for deserialization filter - #5721
[Enhancement] Add structural limits for deserialization filter#5721RyanL1997 wants to merge 3 commits into
Conversation
Follow-up to opensearch-project#5469. Bounds the deserialized object graph with maxdepth/maxrefs/maxbytes limits and logs structural-limit rejections alongside the existing class-rejection logging. Signed-off-by: Jialiang Liang <jiallian@amazon.com>
PR Reviewer Guide 🔍(Review updated until commit 6143db0)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 6143db0 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit ec32115
Suggestions up to commit f73ca59
|
Directly exercises maxdepth, maxrefs, and maxbytes rejections plus the allowlist/additional-pattern paths via ObjectInputFilter.FilterInfo. Signed-off-by: Jialiang Liang <jiallian@amazon.com>
|
Persistent review updated to latest commit ec32115 |
The previous cap rejected legitimate paginated cursors (a SELECT * ... ORDER BY query serializes to 301 refs), causing PaginationIT failures. 1000 leaves comfortable headroom for real cursors while remaining well below deserialization-bomb scale. Test updated to match the new bound. Signed-off-by: Jialiang Liang <jiallian@amazon.com>
|
Persistent review updated to latest commit 6143db0 |
Description
Follow-up to #5469. Adds structural limits (
maxdepth,maxrefs,maxbytes) to the filter created byDeserializationFilterUtil, bounding the size and shape of the deserialized object graph, and logs structural-limit rejections (depth/refs/bytes) alongside the existing class-rejection logging.Related Issues
Follow-up to #5469
Check List
--signoff.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.