Skip to content
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

Ban recursive proto messages from protobuf source #10475

Closed
yuhao-su opened this issue Jun 21, 2023 · 0 comments · Fixed by #10499
Closed

Ban recursive proto messages from protobuf source #10475

yuhao-su opened this issue Jun 21, 2023 · 0 comments · Fixed by #10499
Assignees
Milestone

Comments

@yuhao-su
Copy link
Contributor

yuhao-su commented Jun 21, 2023

message Struct {
  // Unordered map of dynamically typed values.
  map<string, Value> fields = 1;
}

// `Value` represents a dynamically typed value which can be either
// null, a number, a string, a boolean, a recursive struct value, or a
// list of values. A producer of value is expected to set one of these
// variants. Absence of any variant indicates an error.
//
// The JSON representation for `Value` is JSON value.
message Value {
  // The kind of value.
  oneof kind {
    // Represents a null value.
    NullValue null_value = 1;
    // Represents a double value.
    double number_value = 2;
    // Represents a string value.
    string string_value = 3;
    // Represents a boolean value.
    bool bool_value = 4;
    // Represents a structured value.
    Struct struct_value = 5;
    // Represents a repeated `Value`.
    ListValue list_value = 6;
  }
}

google.protobuf.Struct properties is a recursive type. We can cover this case by parsing it to Jsonb.

Meanwhile, we should ban other recursive types.

Originally posted by @yuhao-su in #10443 (comment)

cc. @tabVersion

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 a pull request may close this issue.

2 participants