Live data from Hacker News

Oracle plans to dump risky Java serialization

infoworld.com

91–100 of 157 posts

Re: Oracle plans to dump risky Java serialization

#91

Earlier quoted context omitted.

Blushing because this is the first I've heard of it - I owe you one :)

Where have you been hiding.

I’m beginning to think there really is an xkcd for everything: https://www.xkcd.com/1053/

(Everything that tends to come up on HB, anyway)

Re: Oracle plans to dump risky Java serialization

#92
post #67

Earlier quoted context omitted.

I suggest you look at the myriad security problems caused by Ruby's handling of YAML and JSON. It's not necessarily the serialization format at fault, but rather developer assumptions.

(Here's a post describing some of the problems back in the day with Ruby's YAML and JSON: https://williamedwardscoder.tumblr.com/post/43394068341/ruby... YAML is of course a format that is designed to instantiate objects as described in the source, rather than as checked by the destination, so I wouldn't want the world to adopt YAML instead of Java serialization.)

Read through it, but i wont blame language creators. Its a lot easier to point out that something is broken than to build something better.

Re: Oracle plans to dump risky Java serialization

#93
Oracle has received many reports are received about application servers running on the network with unprotected ports taking serialization streams

I’m just not seeing how this is a problem with the language. Leave anything on an unprotected port taking unsanitised input and it’s vulnerable no matter what it is written in.

Re: Oracle plans to dump risky Java serialization

#95
post #45
post #29

Earlier quoted context omitted.

> create a payload with any of those classes, and send it to the server. 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 anyw…

The security hole is in the design of java serialization. Any class marked serializable (in your code, your included libraries, or the JVM itself) is a potential security vulnerability as soon as you use this feature. Mark estimated that over half of JRE/JDK vulnerabilities have been due to Serialization. Recent releases added an opt-in feature to filter which classes are allowed to be deserialized, but there's still…

> Any class marked serializable (in [...] included libraries [...])

This is the big one: as soon as you deserialize incoming data, any library on the classpath becomes a potential source of remote-callable snippets. And when a vulnerability resides in a library, exploits will tend to be compatible across applications, which makes them far more likely to actually hit you than any custom weaknesses.

Re: Oracle plans to dump risky Java serialization

#96

Earlier quoted context omitted.

(Here's a post describing some of the problems back in the day with Ruby's YAML and JSON: https://williamedwardscoder.tumblr.com/post/43394068341/ruby... YAML is of course a format that is designed to instantiate objects as described in the source, rather than as checked by the destination, so I wouldn't want the world to adopt YAML instead of Java serialization.)

Read through it, but i wont blame language creators. Its a lot easier to point out that something is broken than to build something better.

And it's a lot easier to build a new broken thing, that to fix something broken. Which is what the creators of YAML did.

Re: Oracle plans to dump risky Java serialization

#97

There are so many great alternatives available. It's a no-brainer. I applaud. [edit] so why the downvote? We have YAML, JSON, protobuf, Thrift, Avro. Yup, these serialize "contents" rather than "structure + contents" but one gets interop with other technologies for free. Every tech mentioned above is so simple to use that removing Java serialization is a no-brainer.

Alternatives or not, you open that 'risky' door at the moment you have to read the payload to know what type of data it is. Once it's read, it's already too late.

Java serialization has not many ways around it, you have to trust the sources.

XML, JSON, ... used naively with reflection (e.g. new XStream().fromXML(...)) exposes the exact same issues. Custom homemade parsers are also very likely somehow vulnerable.

The deserialization attack is a way to make the deserializer exploits vulnerable classes that exist in your classpath. It's not generating or executing malicious code by itself.

The standard classes should be ok, or at least fixed quickly.

Things like commons-collection will likely never be fixed. It might be considered as a feature from some point of view.

Check this out: https://github.com/frohoff/ysoserial

My 2 cents: - Secure your sources - Know you format, do not rely on reflection to parse text or binary data - Watch out with your classpath, but you can never know what new vulnerability will pop next weeks

Re: Oracle plans to dump risky Java serialization

#98
post #93

Oracle has received many reports are received about application servers running on the network with unprotected ports taking serialization streams I’m just not seeing how this is a problem with the language. Leave anything on an unprotected port taking unsanitised input and it’s vulnerable no matter what it is written in.

The problem is that the API pretends that it already sanitizes user input to a degree. (from the design perspective, not necessarily documentation)

Sanitizing the input yourself means not using it. You can't sanitize it.

Re: Oracle plans to dump risky Java serialization

#99

There are so many great alternatives available. It's a no-brainer. I applaud. [edit] so why the downvote? We have YAML, JSON, protobuf, Thrift, Avro. Yup, these serialize "contents" rather than "structure + contents" but one gets interop with other technologies for free. Every tech mentioned above is so simple to use that removing Java serialization is a no-brainer.

That would also kill RMI (at least JRMP), and that too would be a good thing, RMI doesn't even pass through a router (unless you do RMI-IIOP - and that is very different from regular RMI - JRMP) For java backwards compatibility used to be very important, so this is big news for the platform. I think this remoting the bytecode with serialisation madness was once upon a time very important part of RMI/serialisation - b…

JMX uses RMI underneath, so that would have to be fixed first before they can remove RMI

Re: Oracle plans to dump risky Java serialization

#100
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.

Ahh, the old "TempleOS is immune to <insert latest vulnerability" defense
Post reply on HN