-
Notifications
You must be signed in to change notification settings - Fork 395
Apply depth limit to unknown groups #756
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
Conversation
… recursion depth.
|
Should not be hard to fix CI #757 |
|
Can you rebase and resubmit please? |
|
Done; CI is passing now. Please take another look, thanks! |
|
Fixed the tests, just let me know if there's anything else you'd like changed. Thanks! |
* Fix issue where a deeply nested unknown group could cause arbitrarily recursion depth. * Add drop(os) to fix tests * Check err message on recursion limit exceeded. * Run formatter * Fix test with .unwrap_err()
|
Thank you! Version v3.7.2 should be published tomorrow or so. |
|
Thanks for the quick action on this. I know folks — myself included — appreciate it. 🙇 @esrauchg Do you think your fix here could be applied to https://github.com/stepancheg/rust-protobuf/tree/v2.28.0? (It doesn't appear as if it would apply cleanly as-is.) And @stepancheg would you entertain a 2.x release for this if the contribution could be made? (The README suggests critical fixes may be accepted, but want to make sure that's still true.) Reason-being: My hunch/observation is that some high-download packages (like prometheus and thus transitively opentelemetry-prometheus) are still dependent on protobuf 2.x and may not be able to swiftly update to 3.x. While I realize that's not a predicament you want to be in and those packages should figure out a path to 3.x (I'm just a messenger here, but I can try to assist!), I suspect the availability of a 2.x would more quickly resolve the impact of the vulnerability across the ecosystem. I know it would for my team, who are currently looking at the "dependency of a dependency" gridlock without much of an option on how to proceed. This 2.x backport would unblock that. |
|
The exact same patch couldn't be applied because things files shifted bit, but it appears the same fix can be done on the 2.28 branch the same issue could be mitigated there by a is.incr_recursion()? / .decr_recursion(); before/after this line: (Whether the 2.x branch is considered EOL for those kind of patches, I wouldn't know) |
|
I've attempted the same fix against 2.28.0 here:
This may suggest the unchecked recursion doesn't apply to the |
They should be migrating to protobuf version 4, which is currently in beta This version of protobuf crate is on the way to archive. |
This avoids the denial of service issue as described on:
#749
https://rustsec.org/advisories/RUSTSEC-2024-0437