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

Potential deserialization error for mismatched classes #84

Open
russgold opened this issue Apr 20, 2020 · 0 comments
Open

Potential deserialization error for mismatched classes #84

russgold opened this issue Apr 20, 2020 · 0 comments

Comments

@russgold
Copy link
Contributor

If the sender's version of a class has a writeObject method, it is considered to use custom serialization, which adds two bytes at the start of the serialized data; however, the receiving side has no way to know if the sender has a writeObject method, as that does not change the repository ID. The code checks the local class to see if it has one, but that is not guaranteed to be the same as the sender's version. That could well cause deserialization to fail, if the two versions of the class differ in that regard.

To fix this, it is clear that the computation of the repository ID must take that into consideration; as far as I can tell, it does not. It is easy to write unit tests that create the failure. If the repositoryID is updated to take this into consideration, such a change will cause the use of FVD deserialization, which will indicate whether custom serialization is being used.

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

No branches or pull requests

1 participant