The code contains a class with sensitive data, but the class is cloneable. The data can then be accessed by cloning the class.
Cloneable classes are effectively open classes, since data cannot be hidden in them. Classes that do not explicitly deny cloning can be cloned by any other class without running the constructor.

Primary

Implementation

Medium

Access Control
Bypass Protection Mechanism
A class that can be cloned can be produced without executing the constructor. This is dangerous since the constructor may perform security-related checks. By allowing the object to be cloned, those checks may be bypassed.

Automated Static Analysis
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Implementation
If you do make your classes clonable, ensure that your clone method is final and throw super.clone().

The following example demonstrates the weakness.

public class CloneClient {
public CloneClient() //throwsjava.lang.CloneNotSupportedException {

Teacher t1 = new Teacher("guddu","22,nagar road");//...// Do some stuff to remove the teacher.Teacher t2 = (Teacher)t1.clone();System.out.println(t2.name);
}public static void main(String args[]) {

new CloneClient();
}
}class Teacher implements Cloneable {

public Object clone() {

try {return super.clone();}catch (java.lang.CloneNotSupportedException e) {

throw new RuntimeException(e.toString());
}
}public String name;public String clas;public Teacher(String name,String clas) {

this.name = name;this.clas = clas;
}
}

Make classes uncloneable by defining a clone function like:

public final void clone() throws java.lang.CloneNotSupportedException {throw new java.lang.CloneNotSupportedException();}

Information leak through class cloning

OBJ07-J
Sensitive classes must not let themselves be copied

SFP23
Exposed Data

Allowed
This CWE entry is at the Variant level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.

CLASP
2006-07-19
Draft 3
2006-07-19

Eric Dalci
Cigital
2008-07-01
updated Time_of_Introduction

CWE Content Team
MITRE
2008-09-08
updated Applicable_Platforms, Common_Consequences, Description, Relationships, Other_Notes, Taxonomy_Mappings

CWE Content Team
MITRE
2008-10-14
updated Other_Notes

CWE Content Team
MITRE
2009-10-29
updated Common_Consequences, Description, Other_Notes, Potential_Mitigations

CWE Content Team
MITRE
2011-03-29
updated Name

CWE Content Team
MITRE
2011-06-01
updated Common_Consequences, Relationships, Taxonomy_Mappings

CWE Content Team
MITRE
2012-05-11
updated Relationships, Taxonomy_Mappings

CWE Content Team
MITRE
2014-07-30
updated Relationships, Taxonomy_Mappings

CWE Content Team
MITRE
2017-11-08
updated Demonstrative_Examples, Potential_Mitigations, Relationships

CWE Content Team
MITRE
2019-01-03
updated Relationships, Taxonomy_Mappings

CWE Content Team
MITRE
2020-02-24
updated References, Relationships

CWE Content Team
MITRE
2021-03-15
updated Relationships

CWE Content Team
MITRE
2023-04-27
updated Relationships

CWE Content Team
MITRE
2023-06-29
updated Mapping_Notes

CWE Content Team
MITRE
2025-12-11
4.19
2025-12-11
updated Applicable_Platforms, Detection_Factors, Weakness_Ordinalities

Information Leak through Class Cloning