CWE-498Cloneable Class Containing Sensitive Information

PUBLISHEDweakness recordMedium
released 2006-07-19 · last modified 2025-12-11

Metadata

CWE ID:
CWE-498
摘要:
Variant
结构:
Simple
状态:
Draft
发布日期:
2006-07-19
更新日期:
2025-12-11

名称

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.

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.

常见后果

范围:
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.

相关 CWE