-
Notifications
You must be signed in to change notification settings - Fork 123
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
Recursive depth on google.protobuf.Structs #143
Comments
I assumed I solved the issue few month ago libprotobuf-mutator/src/text_format.cc Line 31 in dd89da9
Is possible that just 100 breaks your binary? |
Hi @vitalybuka, Apologies for bumping a 5-year-old thread, however, I believe I've encountered an issue like this one. When using LPM integrated with libFuzzer, it is possible for LPM to generate a deeply nested message beyond the limits of the text or binary parsers. This is problematic in the following situation:
In this situation, one may increase the recursion limit via With that said, is there any way to enforce a depth limit at the mutation level that I may have overlooked? In other words, during LPM mutation, if it detects that an add/clone/copy will put the mutated message over some user-provided maximum depth, can that be prevented in favor of shallower field mutation? I believe this would:
If there isn't already a way to enforce this, I'm curious what you'd think would be required to implement such a feature. I would be interested in providing a PR to add such functionality. I've attached a simple example which demonstrates the scenario above. Thank you. |
Hi,
It seems like one of our fuzzers is failing because of a stack-overflow in protobuf's
TextFormat::Parser
. The input that libprotobuf-mutator created was a Struct that has a large recursive depth, but is not enough to trigger the max recursion limit in the parser (which is by default 2^15 - 1).https://github.com/protocolbuffers/protobuf/blob/6fc04c3f0e07857dff1f55b884f957b4c65aea8e/src/google/protobuf/text_format.cc#L1383.
Is there some environment variable we could set to limit the recursive depth that LPM creates, or another way to handle such an input?
Thanks!
The text was updated successfully, but these errors were encountered: