Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

Code Block
private void writeObject(java.io.ObjectOutputStream out) 
    throws IOException;
private void readObject(java.io.ObjectInputStream in)
    throws IOException, ClassNotFoundException;
private void readObjectNoData() throws ObjectStreamException;

Wiki MarkupNote that these methods must be declared private for any serializable class. Serializable classes may also implement the {{readResolve()}} and {{writeReplace()}} methods.
According to the Serialization Specification \[ [Sun 2006|AA. References#Sun 06]\], {{readResolve()}} and {{writeReplace()}} method documentation:

For Serializable and Externalizable classes, the readResolve method allows a class to replace/resolve the object read from the stream before it is returned to the caller. By implementing the readResolve method, a class can directly control the types and instances of its own instances being deserialized.

For Serializable and Externalizable classes, the writeReplace method allows a class of an object to nominate its own replacement in the stream before the object is written. By implementing the writeReplace method, a class can directly control the types and instances of its own instances being serialized.

...

MITRE CWE

CWE-502. Deserialization of untrusted data

Bibliography

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="9d878c59-4b31-4538-b4da-ab09c61fd782"><ac:plain-text-body><![CDATA[

[[API 2006AA. References#API 06] ]

Serializable]]></ac:plain-text-body></ac:structured-macro><ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="0178f097-c9b0-4019-b639-8c0ee6072cee"><ac:plain-text-body><!

[CDATA[ [[Sun 2006AA. References#Sun 06]]

Serialization Specification

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="5834a2b3-fccb-4ad3-9aed-06dc1507dced"><ac:plain-text-body><![CDATA[

[[Ware 2008AA. References#Ware 08]]

 ]]></ac:plain-text-body></ac:structured-macro>

...

      13. Serialization (SER)      SER02-J. Sign then seal sensitive objects before sending them outside a trust boundary