eclipse-ee4j / eclipse-ee4j/orb

Potential deserialization error for mismatched classes

Open
#84 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
30
Forks
28
Avg merge
3h 43m
Merged PRs (30d)
9

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.