Skip to content

Conversation

@aviralgarg05
Copy link

This fixes a security vulnerability where nested google.protobuf.Any messages could bypass the max_recursion_depth limit, potentially leading to denial of service via stack overflow.

The root cause was that _ConvertAnyMessage() was calling itself recursively via methodcaller() for nested well-known types, bypassing the recursion depth tracking in ConvertMessage().

The fix routes well-known type parsing through ConvertMessage() to ensure proper recursion depth accounting for all message types including nested Any.

Fixes #25070

This fixes a security vulnerability where nested google.protobuf.Any messages
could bypass the max_recursion_depth limit, potentially leading to denial of
service via stack overflow.

The root cause was that _ConvertAnyMessage() was calling itself recursively
via methodcaller() for nested well-known types, bypassing the recursion depth
tracking in ConvertMessage().

The fix routes well-known type parsing through ConvertMessage() to ensure
proper recursion depth accounting for all message types including nested Any.

Fixes protocolbuffers#25070
@aviralgarg05 aviralgarg05 requested a review from a team as a code owner January 9, 2026 15:34
@aviralgarg05 aviralgarg05 requested review from anandolee and removed request for a team January 9, 2026 15:34
@anandolee anandolee self-assigned this Jan 12, 2026
@anandolee anandolee added python 🅰️ safe for tests Mark a commit as safe to run presubmits over labels Jan 12, 2026
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Any JSON recursion depth bypass in Python json_format.ParseDict

2 participants