Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Serialization can be used maliciously, for example, to return multiple instances of a singleton class object. In this noncompliant code example (based on [Bloch 2005]), a subclass SensitiveClass inadvertently becomes serializable because it extends the java.lang.Number class, which implements Serializable.

...

MITRE CWE

CWE-499. Serializable class containing sensitive data

 

CWE-502. Deserialization of untrusted data

Secure Coding Guidelines for the Java Programming Language, Version 3.0

Guideline 5-2. Guard sensitive data during serialization

Bibliography

[Bloch 2005]

Puzzle 83. Dyslexic monotheism

[Bloch 2001]

Item 1. Enforce the singleton property with a private constructor

[Greanier 2000]

Discover the Secrets of the Java Serialization API

[Harold 1999]

 

[JLS 2005]

Transient Modifier

[Long 2005]

Section 2.4, Serialization

[Sun 2006]

Serialization Specification, A.4, Preventing Serialization of Sensitive Data

...

SER02-J. Sign then seal sensitive objects before sending them outside a trust boundary      Rule 14: Serialization (SER)Image Added