Project discussions

Security in Computing (3rd Edition)

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 161 Computer Security Fall 2005 Joseph/Tygar/Vazirani/Wagner Notes 22 Object Serialization in Java Java’s object serialization mechanism is a convenient way to store Java objects on disk. It is also tempting to use this mechanism as a building block for network protocols. This mini-lecture describes the pitfalls of us- ing object serialization in this way, and offers some suggestions on how you could begin to use serialization in your own networking protocols. Disclaimer: These notes are not a complete discussion of the problems inherant in object serialization, and are simply a few problems that the T.A.’s and professors have noticed over the last week. We do not know of a comprehensive source that describes how Java’s object serialization mechanism can be used sercurely. 1 What Can Go Wrong The biggest problem with using serializable over a network connection is that readObject() returns an in- stantiated object of a type controlled by the sender of the message. The implementation of this object must be somewhere on your classpath for the deserialization to succeed. Java ships with many classes that implement serializable, and many third-party libraries also implement serializable. Worse, Java allows objects to implement their own deserialize methods. If you use the default ObjectInputStream, the creator of the objects you are deserializing can trick you into running any code in any of these custom deserialize methods. The best you can do without subclassing ObjectInputStream is to immediately cast objects that it returns to
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/29/2008 for the course CS 194 taught by Professor Joseph during the Fall '05 term at Berkeley.

Page1 / 3

Project discussions - CS 161 Fall 2005...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online