Skip to content

Restore compatibility of runtime with pre-3.22.x gencode impacted by CVE-2022-3171 #22862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 4, 2025

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented Jul 30, 2025

Restore compatibility of runtime with pre-3.22.x gencode impacted by CVE-2022-3171

Generated code from this range is covered by CVE-2022-3171 and potentially vulnerable to a Denial of Service issue.

JavaProto 4.x previously dropped compatibility with the potentially vulnerable generated code, having the behavior of:

  • The vulnerable generated code was source-incompatible with new runtime (would not compile when built from source)

  • The vulnerable generated code was ABI-incompatible with new runtime (when using a .class file compiled against old runtime, a NoSuchMethodException would be thrown at parse time).

After this change, instead:

  • The vulnerable generated code is now source-compatible (will compile).
    The first time each potentially vulnerable type is parsed, an error message will be logged noting that potentially vulnerable generated code is in use and the name of the corresponding type.

  • Environment variables may be set to either throw an exception instead (-Dcom.google.protobuf.error_on_unsafe_pre22_gencode) or to entirely silence the logged messages (-Dcom.google.protobuf.use_unsafe_pre22_gencode)
    This change was made based on community feedback regarding the difficulty in identifying and quickly remediating stale gencode in their transitive dependencies weighed against a careful evaluation of the realistic risk exposure of DoS (with no risk of other concerns including information leak or RCE).

We strongly recommend that any users who observe the log messages to regenerate the corresponding code with a newer protoc. We recommend that any security-conscious services opt into error_on_unsafe_pre22_gencode to preclude any risk of a Denial of Service surface area being exposed.

A future release may flip the default behavior to error by default as a measure to further help the ecosystem avoid the Denial of Service risks.

@copybara-service copybara-service bot changed the title Allow pre-22 gencode to run on 4.x Restore compatibility of runtime with gencode created with protoc <3.21 Jul 30, 2025
@copybara-service copybara-service bot changed the title Restore compatibility of runtime with gencode created with protoc <3.21 Restore compatibility of runtime with pre-3.22.x gencode impacted by CVE-2022-3171 Aug 4, 2025
…VE-2022-3171

Generated code from this range is covered by CVE-2022-3171 and potentially vulnerable to a Denial of Service issue.

JavaProto 4.x previously dropped compatibility with the potentially vulnerable generated code, having the behavior of:

* The vulnerable generated code was source-incompatible with new runtime (would not compile when built from source)

* The vulnerable generated code was ABI-incompatible with new runtime (when using a .class file compiled against old runtime, a NoSuchMethodException would be thrown at parse time).

After this change, instead:

* The vulnerable generated code is now source-compatible (will compile).
The first time each potentially vulnerable type is parsed,  an error message will be logged noting that potentially vulnerable generated code is in use and the name of the corresponding type.

* Environment variables may be set to either throw an exception instead (-Dcom.google.protobuf.error_on_unsafe_pre22_gencode) or to entirely silence the logged messages (-Dcom.google.protobuf.use_unsafe_pre22_gencode)
This change was made based on community feedback regarding the difficulty in identifying and quickly remediating stale gencode in their transitive dependencies weighed against a careful evaluation of the realistic risk exposure of DoS (with no risk of other concerns including information leak or RCE).

We strongly recommend that any users who observe the log messages to regenerate the corresponding code with a newer protoc. We recommend that any security-conscious services opt into error_on_unsafe_pre22_gencode to preclude any risk of a Denial of Service surface area being exposed.

A future release may flip the default behavior to error by default as a measure to further help the ecosystem avoid the Denial of Service risks.

PiperOrigin-RevId: 790798112
@copybara-service copybara-service bot merged commit 7c51e5b into main Aug 4, 2025
@copybara-service copybara-service bot deleted the test_788863116 branch August 4, 2025 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant