3 ms·
Thanks for your reply. This is Thursday in the UK so I'm going to pre-emptively apologise for this rant. But we in the infosec community informed the wider comm
by benmmurphy 10y ago
Thanks for your reply. This is Thursday in the UK so I'm going to pre-emptively apologise for this rant. But we in the infosec community informed the wider community in 2008 of the problems of Java Serialiazation. That is 8 years ago. Sami Koivu, peace be upon him in December 2008 showed that arbitrary deserialisation in Java was a security risk (http://slightlyrandombrokenthoughts.blogspot.co.uk/2008/12/calendar-bug.html http://slightlyrandombrokenthoughts.blogspot.co.uk/2008/12/c...). Not to mention that SERIAL-5 (http://www.oracle.com/technetwork/java/seccodeguide-139067.html http://www.oracle.com/technetwork/java/seccodeguide-139067.h...) of the Java Security Guidelines for Java SE has this to say:
Guideline 8-5 / SERIAL-5: Understand the security permissions given to serialization and deserialization
Permissions appropriate for deserialization should be carefully checked. Additionally, deserialization of untrusted data should generally be avoided whenever possible.
And do you want to have a guess as to how many times Serialization was used to bypass the Java Sandbox between when Sami Kouvi made his blogpost and someone made a con talk on about Apache. Hint: it is greater than 1. [https://tyranidslair.blogspot.co.uk/2013/02/fun-with-java-serialization-and.html https://tyranidslair.blogspot.co.uk/2013/02/fun-with-java-se...]
We have also demonstrated numerous times to the programming community that deserialzation of user data is dangerous. For example Stefan Esser has shown numerous times that PHP deserialization is dangerous both because PHP deserialization is a source of bugs in itself and because it is a source of bugs because it interacts with application code in unexpected ways. We have seen the same thing in both python with unpickle and ruby with YAML.
I'm going to let you in to a secret within the infosec community. You can find bugs by just applying existing research in new and novel ways because developers do not follow security research.
I feel like I'm falling into some rationalism fallacy by ranting at you because you are doing something useful to improve security. But you could be doing much much more. You have a voice and people will actually read your blog as compared to Sami :( You could have mentioned that we people should stop doing ObjectStream#readObject() or you could have pushed for updating the JavaDoc to say: THIS IS A BAD THING DO NOT DO IT.
EDIT: apologies to anyone that realized that java serialization was bad before the Sami post. I wouldn't be surprised if this was part of the Java secure code guidelines before then or if someone had exploited the issue before then. It just so happens that Sami's post was my introduction to Java Serialization vulnerabilities.
- gebl 10y agoAs one of the people who did the talk at Appsec Cali that was building on all this work outlined by benmurphy... our goal was to reach security minded developers and talk about a repeated anti-pattern that put software at risk that impacts things written in many different languages. Both Chris and I have a development background, and have seen the same issue show up in ruby, python, php, basically anything that has an object serialization capability. We hoped to change the focus from a specific library or gadget to the idea that deserialization is inherently dangerous. The core problem really stems from the idea that OO models encapsulate data and behaviors. Behaviors mean code execution - so, anything that will deserialize objects is giving the person who serialized them the ability to control the execution flow. If this is a listener on the network, than things are really bad :-) So, it's great that a set of gadgets have been removed, it's neat to see the application of resources to make that happen. I have to agree with Ben, that any system that relies on object serialization from untrusted sources (in any language) is still vulnerable, it just might require a more specific gadget chain. Too many vendors have fixed their products by just updating the library and not removing the dependency on dangerous object deserailization.
- jart 10y agoWhy did no one tell Apache?
- gebl 10y agohttps://blogs.apache.org/foundation/entry/apache_commons_statement_to_widespread https://blogs.apache.org/foundation/entry/apache_commons_sta... "So replacing your installations with a hardened version of Apache Commons Collections will not make your application resist this vulnerability."
- jart 10y agoOk well you can tell your cohort that this narrative isn't going to fly anymore.
- 10y ago