Serializable Class Containing Sensitive Data |
Weakness ID: 499 (Weakness Variant) | Status: Draft |
Description Summary
The code contains a class with sensitive data, but the class does not explicitly deny serialization. The data can be accessed by serializing the class through another class.
Extended Description
Serializable classes are effectively open classes since data cannot be hidden in them. Classes that do not explicitly deny serialization can be serialized by any other class, which can then in turn use the data stored inside it.
Scope | Effect |
---|---|
Confidentiality | an attacker can write out the class to a byte stream, then extract the important data from it. |
Example 1
(Bad Code)
Example Language: Java
class Teacher {
private String name;
private String clas;
public Teacher(String name,String clas) {
//...
//Check the database for the name and address
this.SetName() = name;
this.Setclas() = clas;
}
}
Phase: Implementation In Java, explicitly define final writeObject() to prevent serialization. This is the recommended solution. Define the writeObject() function to throw an exception explicitly denying serialization. |
Phase: Implementation Make sure to prevent serialization of your objects. |
Nature | Type | ID | Name | View(s) this relationship pertains to![]() |
---|---|---|---|---|
ChildOf | ![]() | 485 | Insufficient Encapsulation | Development Concepts (primary)699 Research Concepts (primary)1000 |
CanPrecede | ![]() | 200 | Information Exposure | Development Concepts699 Research Concepts1000 |
Mapped Taxonomy Name | Node ID | Fit | Mapped Node Name |
---|---|---|---|
CLASP | Information leak through serialization |
Submissions | ||||
---|---|---|---|---|
Submission Date | Submitter | Organization | Source | |
CLASP | Externally Mined | |||
Modifications | ||||
Modification Date | Modifier | Organization | Source | |
2008-07-01 | Eric Dalci | Cigital | External | |
updated Time of Introduction | ||||
2008-09-08 | CWE Content Team | MITRE | Internal | |
updated Common Consequences, Description, Relationships, Taxonomy Mappings | ||||
2009-07-27 | CWE Content Team | MITRE | Internal | |
updated Demonstrative Examples | ||||
Previous Entry Names | ||||
Change Date | Previous Entry Name | |||
2008-04-11 | Information Leak through Serialization | |||