CWE-498: Cloneable Class Containing Sensitive Information
The code contains a class with sensitive data, but the class is cloneable. The data can then be accessed by cloning the class.
Last updated
Overview
CWE-498 (Cloneable Class Containing Sensitive Information) is a variant-level software weakness catalogued by MITRE in the Common Weakness Enumeration (CWE). It describes a recurring type of mistake that can lead to exploitable security vulnerabilities.
Common consequences
What can happen when CWE-498 is exploited.
Bypass Protection Mechanism, Read Application Data
Affects: Access Control, Confidentiality
A class that does not explicitly deny cloning can be cloned by any other class without running the constructor. Cloneable classes are effectively open classes, since data cannot be hidden in the. This is also dangerous since the constructor may perform security-related checks. By allowing the object to be cloned, those checks may be bypassed.
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
Applies to
Languages