Add recursion depth check for TYPE_GROUP in UntypedMessage::Decode()#26467
Open
lonelybones wants to merge 2 commits intoprotocolbuffers:mainfrom
Open
Add recursion depth check for TYPE_GROUP in UntypedMessage::Decode()#26467lonelybones wants to merge 2 commits intoprotocolbuffers:mainfrom
lonelybones wants to merge 2 commits intoprotocolbuffers:mainfrom
Conversation
esrauchg
approved these changes
Mar 25, 2026
958c2e6 to
0978b44
Compare
UntypedMessage::Decode() in the BinaryToJson code path was missing a call to stream.IncrementRecursionDepth() for WIRETYPE_START_GROUP, allowing unbounded stack recursion via deeply nested groups. The parallel handler for TYPE_MESSAGE in DecodeDelimited() already had this check. This is the same class of issue as CVE-2024-7254 (protobuf-java). Fixes https://issuetracker.google.com/issues/493306525
0978b44 to
112e529
Compare
Contributor
|
@lonelybones looks like there are failing tests. Please fix. |
112e529 to
efb178f
Compare
Author
|
Fixed. Removed the incorrect Bazel dep, built and tested locally with 'bazel test //src/google/protobuf/json:json_test' before pushing. |
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.
UntypedMessage::Decode() in the BinaryToJson code path was missing a call to stream.IncrementRecursionDepth() for WIRETYPE_START_GROUP, allowing unbounded stack recursion via deeply nested groups. The parallel handler for TYPE_MESSAGE in DecodeDelimited() already had this check.
This is the same class of issue as CVE-2024-7254 (protobuf-java).
Fixes https://issuetracker.google.com/issues/493306525