Repository navigation
Conversation
Type, name-mapping and expression parsers walk parsed JSON recursively, so a deeply nested document could exhaust the stack. Check the nesting depth of objects and arrays iteratively right after parsing in FromJsonString and FileMetadataFromJsonString, and reject documents nested deeper than 1000 levels, matching the default limit of Jackson's StreamReadConstraints.
shangxinli
reviewed
Oct 16, 2026
| if (json.is_discarded()) [[unlikely]] { | ||
| return JsonParseError("Failed to parse JSON string: {}", json_string); | ||
| } | ||
| ICEBERG_RETURN_UNEXPECTED(CheckJsonNestingDepth(json)); |
Contributor
There was a problem hiding this comment.
This and the puffin one cover two of the three nlohmann::json::parse sites; catalog/rest/auth/oauth2_util.cc:186 parses a JWT payload straight off the token endpoint and isn't gated. It only reads the exp claim, so leaving it out may well be deliberate - worth saying so if it is.
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.
Type, name-mapping and expression parsers walk parsed JSON recursively, so a deeply nested document could exhaust the stack. Check the nesting depth of objects and arrays iteratively right after parsing in FromJsonString and FileMetadataFromJsonString, and reject documents nested deeper than 1000 levels, matching the default limit of Jackson's StreamReadConstraints.