1

What I want to do is to validate the data inside a protobuf message before I send it to an external network. This is providing a security check.

The problem is that protobufs allow sending additional fields using an updated proto file, which allows backwards compatibility.

What this means is when I go to check a message, my autogenerated code parses the object, but drops the unknown fields. So this means the transmitted bytes could have information I don't know about.

A work around would be to transmit the version of data I have parsed and checked, which would mean dropping the new fields. That's the right security thing to do, but I still won't know that someone is sending me new version of messages. It would be nice to log that and be told I might need to update. I also want to communicate back to the sender that some of their data is being dropped.

Is there a way to know if the format of the message I received mismatches from the format I expect to receive?

BAMF4bacon
  • 523
  • 1
  • 7
  • 21

0 Answers0