Can someone briefly explain the problems and how general they are to other serialization interfaces?
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.
Oracle plans to dump risky Java serialization
21–30 of 157 posts
Re: Oracle plans to dump risky Java serialization
#22Having used java serialization a few times for POC level work, I'll be sorry to see it go. I wish they would just rename it something sufficiently ominous sounding that people wouldn't think about using it on untrusted data sources. Maybe AribitraryCodeAndDataSerialization
Coming from a Javascript context, would this be something roughly analogous to expecting JSON.parse and actually getting eval?
As you can imagine, any sufficiently large codebase is likely to have a million different ways this can be leveraged to get arbitrary code execution.
Re: Oracle plans to dump risky Java serialization
#23Earlier quoted context omitted.
One of the attack vector in Java was classes storing native pointers as integer fields calling free on the above pointers in the finalizer. So the moment one can force deserialiazation of such classes one ends up with corrupted heap and trivially weponized exploits. Does pickle in Python suffer from the same problem?
Arbitrary code execution: https://www2.cs.uic.edu/~s/musings/pickle/
Re: Oracle plans to dump risky Java serialization
#24Having used java serialization a few times for POC level work, I'll be sorry to see it go. I wish they would just rename it something sufficiently ominous sounding that people wouldn't think about using it on untrusted data sources. Maybe AribitraryCodeAndDataSerialization
Re: Oracle plans to dump risky Java serialization
#25Having used java serialization a few times for POC level work, I'll be sorry to see it go. I wish they would just rename it something sufficiently ominous sounding that people wouldn't think about using it on untrusted data sources. Maybe AribitraryCodeAndDataSerialization
Be curious to do a Github wide grep for ObjectOutputStream or something similar and see what it's like in open source land.
Re: Oracle plans to dump risky Java serialization
#26Re: Oracle plans to dump risky Java serialization
#27Earlier quoted context omitted.
Is it really going away, though? The article mentions that it's just being replaced with a safer implementation.
I may be wrong, but to me it seems like they will replace the current implementation with something fundamentally incompatible. My impression is that dependencies like RMI will go away, too. But that would be a huge breaking change.
Re: Oracle plans to dump risky Java serialization
#28I would hate to see serialization go completely. It has its uses. Maybe Java should copy the attributes that the C# data contract serializer uses to mark the subset of classes that may appear in serialized form. It coukd be retrofitted and would be a less drastic change at the same time.
Java has had the "transient" keyword for that since 1.0.
Re: Oracle plans to dump risky Java serialization
#29Can someone briefly explain the problems and how general they are to other serialization interfaces?
The problems is, any class (that's serializable) that is on the target machine's classpath, can be used as a serializable object. So if i want to screw with a server, i can create a payload with any of those classes, and send it to the server. The server will load that class when it sees it in the payload, and will execute code any code in the classes static initializer, before trying to instantiate an object. All of…
But on a deeper level, if a programmer doesn't know anything about security, then this sort of hole will continue to happen even if java serialization is disabled (just a bit harder to screw up). I m not that big of a fan of making security decisions without programmer's input, since you'd assume a professional programmer should know better anyway.
Re: Oracle plans to dump risky Java serialization
#30Earlier quoted context omitted.
Arbitrary code execution: https://www2.cs.uic.edu/~s/musings/pickle/
That only works because Python is an interpreter. Won't cause a thing on Java.