Skip to content

Conversation

@aviralgarg05
Copy link
Contributor

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

@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
Copy link

@ankitsinha-cmyk ankitsinha-cmyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider:

  1. Add a comment clarifying how you count depth and whether max_recursion_depth is inclusive/exclusive.

  2. Adding a test that explicitly asserts that depth==max_recursion_depth-1 succeeds and depth==max_recursion_depth fails, so the boundary behavior is documented.

@benglewis
Copy link

I understand this this is failing CI/CD and all... but we are stuck with our packages failing on vulnerabilities with this fix. What is the ETA for getting this merged?

Copy link

@ankitsinha-cmyk ankitsinha-cmyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aviralgarg05 thanks for incorporating the changes. Looks fine to me now.

lebaudantoine added a commit to suitenumerique/meet that referenced this pull request Jan 25, 2026
A new vulnerability (CVE-2026-0994) was reported and is not yet fixed. It affects
protobuf libraries used by the livekit-api Python package.

A fix is in progress upstream, but the related PR has not yet been merged or
released. Since a release is required tonight, the Trivy scan step is
temporarily disabled to allow the build to proceed. This should be re-enabled
once a patched version is available.

protocolbuffers/protobuf#25239
lebaudantoine added a commit to suitenumerique/meet that referenced this pull request Jan 25, 2026
A new vulnerability (CVE-2026-0994) was reported and is not yet fixed.
It affects protobuf libraries used by the livekit-api Python package.

A fix is in progress upstream, but the related PR has not yet been merged or
released. Since a release is required tonight, the Trivy scan step is
temporarily disabled to allow the build to proceed. This should be re-enabled
once a patched version is available.

protocolbuffers/protobuf#25239
lebaudantoine added a commit to suitenumerique/meet that referenced this pull request Jan 25, 2026
A new vulnerability (CVE-2026-0994) was reported and is not yet fixed.
It affects protobuf libraries used by the livekit-api Python package.

A fix is in progress upstream, but the related PR has not yet been merged or
released. Since a release is required tonight, the Trivy scan step is
temporarily disabled to allow the build to proceed. This should be re-enabled
once a patched version is available.

protocolbuffers/protobuf#25239
lebaudantoine added a commit to suitenumerique/meet that referenced this pull request Jan 25, 2026
A new vulnerability (CVE-2026-0994) was reported and is not yet fixed.
It affects protobuf libraries used by the livekit-api Python package.

A fix is in progress upstream, but the related PR has not yet been merged or
released. Since a release is required tonight, the Trivy scan step is
temporarily disabled to allow the build to proceed. This should be re-enabled
once a patched version is available.

protocolbuffers/protobuf#25239
aponcedeleonch added a commit to StacklokLabs/mcp-optimizer that referenced this pull request Jan 26, 2026
This will enable running the CI and its checks. There is a fix
upstream waiting to be merged and released: protocolbuffers/protobuf#25239
aponcedeleonch added a commit to StacklokLabs/mcp-optimizer that referenced this pull request Jan 26, 2026
This will enable running the CI and its checks. There is a fix
upstream waiting to be merged and released: protocolbuffers/protobuf#25239
aponcedeleonch added a commit to StacklokLabs/mcp-optimizer that referenced this pull request Jan 26, 2026
This will enable running the CI and its checks. There is a fix
upstream waiting to be merged and released: protocolbuffers/protobuf#25239
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 force-pushed the fix-any-recursion-depth-bypass branch from 3cbbcbe to b210265 Compare January 29, 2026 14:47
@esrauchg esrauchg added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jan 29, 2026
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jan 29, 2026
copybara-service bot pushed a commit that referenced this pull request Jan 29, 2026
COPYBARA_INTEGRATE_REVIEW=#25239 from aviralgarg05:fix-any-recursion-depth-bypass 3cbbcbe
FUTURE_COPYBARA_INTEGRATE_REVIEW=#25239 from aviralgarg05:fix-any-recursion-depth-bypass 3cbbcbe
PiperOrigin-RevId: 862763331
copybara-service bot pushed a commit that referenced this pull request Jan 29, 2026
COPYBARA_INTEGRATE_REVIEW=#25239 from aviralgarg05:fix-any-recursion-depth-bypass 3cbbcbe
FUTURE_COPYBARA_INTEGRATE_REVIEW=#25239 from aviralgarg05:fix-any-recursion-depth-bypass 3cbbcbe
PiperOrigin-RevId: 862763331
@copybara-service copybara-service bot mentioned this pull request Jan 29, 2026
copybara-service bot pushed a commit that referenced this pull request Jan 29, 2026
COPYBARA_INTEGRATE_REVIEW=#25239 from aviralgarg05:fix-any-recursion-depth-bypass 3cbbcbe
FUTURE_COPYBARA_INTEGRATE_REVIEW=#25239 from aviralgarg05:fix-any-recursion-depth-bypass 3cbbcbe
PiperOrigin-RevId: 862763331
copybara-service bot pushed a commit that referenced this pull request Jan 29, 2026
COPYBARA_INTEGRATE_REVIEW=#25239 from aviralgarg05:fix-any-recursion-depth-bypass 3cbbcbe
FUTURE_COPYBARA_INTEGRATE_REVIEW=#25239 from aviralgarg05:fix-any-recursion-depth-bypass 3cbbcbe
PiperOrigin-RevId: 862763331
copybara-service bot pushed a commit that referenced this pull request Jan 29, 2026
In the case of quotes and backslashes (which are the most common things that need escaping) we can avoid going into Utf8 bytes for most cases this way, while also only doing 1 pass over the string when it doesn't need escaping at all.

COPYBARA_INTEGRATE_REVIEW=#25239 from aviralgarg05:fix-any-recursion-depth-bypass 3cbbcbe
FUTURE_COPYBARA_INTEGRATE_REVIEW=#25239 from aviralgarg05:fix-any-recursion-depth-bypass 3cbbcbe
PiperOrigin-RevId: 862311595
copybara-service bot pushed a commit that referenced this pull request Jan 29, 2026
COPYBARA_INTEGRATE_REVIEW=#25239 from aviralgarg05:fix-any-recursion-depth-bypass 3cbbcbe
FUTURE_COPYBARA_INTEGRATE_REVIEW=#25239 from aviralgarg05:fix-any-recursion-depth-bypass 3cbbcbe
PiperOrigin-RevId: 861246215
@copybara-service copybara-service bot mentioned this pull request Jan 29, 2026
copybara-service bot pushed a commit that referenced this pull request Jan 29, 2026
COPYBARA_INTEGRATE_REVIEW=#25239 from aviralgarg05:fix-any-recursion-depth-bypass 3cbbcbe
FUTURE_COPYBARA_INTEGRATE_REVIEW=#25239 from aviralgarg05:fix-any-recursion-depth-bypass 3cbbcbe
PiperOrigin-RevId: 862635690
@copybara-service copybara-service bot mentioned this pull request Jan 29, 2026
copybara-service bot pushed a commit that referenced this pull request Jan 29, 2026
COPYBARA_INTEGRATE_REVIEW=#25239 from aviralgarg05:fix-any-recursion-depth-bypass 3cbbcbe
FUTURE_COPYBARA_INTEGRATE_REVIEW=#25239 from aviralgarg05:fix-any-recursion-depth-bypass 3cbbcbe
PiperOrigin-RevId: 861910783
@copybara-service copybara-service bot mentioned this pull request Jan 29, 2026
zhangskz pushed a commit that referenced this pull request Jan 29, 2026
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

Closes #25239

COPYBARA_INTEGRATE_REVIEW=#25239 from aviralgarg05:fix-any-recursion-depth-bypass 3cbbcbe
PiperOrigin-RevId: 862740421
zhangskz pushed a commit that referenced this pull request Jan 29, 2026
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

Closes #25239

COPYBARA_INTEGRATE_REVIEW=#25239 from aviralgarg05:fix-any-recursion-depth-bypass 3cbbcbe
PiperOrigin-RevId: 862740421
zhangskz added a commit that referenced this pull request Jan 29, 2026
… (#25586)

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

Closes #25239

COPYBARA_INTEGRATE_REVIEW=#25239 from aviralgarg05:fix-any-recursion-depth-bypass 3cbbcbe
PiperOrigin-RevId: 862740421

Co-authored-by: Aviral Garg <[email protected]>
zhangskz added a commit that referenced this pull request Jan 29, 2026
… (#25587)

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

Closes #25239

COPYBARA_INTEGRATE_REVIEW=#25239 from aviralgarg05:fix-any-recursion-depth-bypass 3cbbcbe
PiperOrigin-RevId: 862740421

Co-authored-by: Aviral Garg <[email protected]>
@crmpicco
Copy link

Thanks @paulhodson , that is a useful tip for future

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