Live data from Hacker News

Oracle plans to dump risky Java serialization

infoworld.com

31–40 of 157 posts

Re: Oracle plans to dump risky Java serialization

#33

Earlier quoted context omitted.

Many runtimes include object serialization capabilities, which allow serialization of essentially arbitrary object structures with little code. Unpacking that kind of structure always means that you're constructing object instances of potentially any object you can construct, which generally means you can run arbitrary code. Examples: Java Serialization, Python marshal and pickle, Ruby marshal, Perl Data::Dumper.

So the problems don't apply to, say, rust because rust doesn't run arbitrary initialization when building structures?

This is a key point. The problem is significantly worse because of Java's "everything is an object" philosophy. In languages where data is just data and not a combination of data and behavior, you don't get this kind of problem.

Re: Oracle plans to dump risky Java serialization

#34
post #28

Earlier quoted context omitted.

Java has had the "transient" keyword for that since 1.0.

It also didn't have serialization in 1.0 neatly avoiding the entire problem.

You're right, it was introduced in 1.1 (February 1997)

Re: Oracle plans to dump risky Java serialization

#35
post #33

Earlier quoted context omitted.

So the problems don't apply to, say, rust because rust doesn't run arbitrary initialization when building structures?

This is a key point. The problem is significantly worse because of Java's "everything is an object" philosophy. In languages where data is just data and not a combination of data and behavior, you don't get this kind of problem.

You also don't get this behavior if you restrict the scope of serialization. The problem here was that Java wanted to make virtually any object potentially serializable. This required all sorts of deep hacks that circumvent various language guarantees and open the door to vulnerabilities (as well as encumber new features, as serialization could interact with anything). A new serialization mechanism would be restricted to classes for which serialization makes sense, basically classes that, as you say, represent data rather than data with complex behavior.
Post reply on HN