MOD-18588 - create new dedicated config fr checking depth in old rdbs - #1657
Open
TalBarYakar wants to merge 1 commit into
Open
TalBarYakar wants to merge 1 commit into
TalBarYakar wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d469210. Configure here.
| && depth >= MAX_DEPTH | ||
| && matches!(node_type, NodeType::Dict | NodeType::Array) | ||
| { | ||
| return Err(crate::manager::err_recursion_limit_exceeded()); |
There was a problem hiding this comment.
Depth-128 restore still fails
Medium Severity
The new check counts depth from 0, so 128 nested containers pass json-legacy-rdb-depth-limit. RESTORE then re-parses through from_str with the serde_json recursion limit still enabled, which already rejects 128 nested containers. The documented and tested depth-128 success path therefore still fails.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit d469210. Configure here.
This branch has not been deployed
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.


Note
Medium Risk
Changes RDB/RESTORE behavior for legacy encver 0 snapshots when the opt-in config is enabled; misconfiguration could reject valid deep legacy dumps, but default remains off.
Overview
Adds an optional module setting
json-legacy-rdb-depth-limit(default no, documented inmodule.conf) so loading legacy encver 0 RedisJSON RDB data can enforce the same 128-level nesting cap as JSON path operations.When enabled, the legacy loader in
backward.rstracks recursion depth while parsing dict/array nodes and fails with the existing recursion-limit error before deeply nested RESTORE / RDB loads can blow the stack. The flag is registered in module configuration and can be toggled at runtime viaCONFIG SET.Pytest coverage crafts nested legacy array DUMP/RESTORE payloads: depth 128 succeeds with the limit on, depth 129 is rejected without crashing the server.
Reviewed by Cursor Bugbot for commit d469210. Bugbot is set up for automated code reviews on this repo. Configure here.