Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Don't rely on protobuf field serialization order #1357

Open
jtoohill opened this issue Sep 11, 2019 · 1 comment
Open

Don't rely on protobuf field serialization order #1357

jtoohill opened this issue Sep 11, 2019 · 1 comment

Comments

@jtoohill
Copy link
Contributor

Per the protobuf encoding guide, "Serialization order is an implementation detail and the details of any particular implementation may change in the future".

We rely on signatures over serialized protobufs in the google.keytransparency.v1.SignedEntry proto. There's probably other places as well, that's just the first one that come to mind. It happens to work because the protobuf implementation we use has a stable serialization order, but that shouldn't be relied on.

@jtoohill
Copy link
Contributor Author

In particular, we compare serialized protos in the replay detection here. A new mutation with the same Entry but a different serialization wouldn't be caught by that check.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant