CWE一覧に戻る
CWE-498

機密情報を含むクローン可能なクラス

Cloneable Class Containing Sensitive Information
脆弱性 レビュー中
JA

このコードには機密データを持つクラスが含まれているが、そのクラスはクローン可能である。そのため、クラスをクローンすることでデータにアクセスできる。

クローン可能なクラスは、データを隠すことができないので、事実上オープン・クラスです。クローンを明示的に拒否していないクラスは、コンストラクタを実行しなくても他のクラスからクローンを作成することができます。

EN

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.

Scope: Access Control / Impact: Bypass Protection Mechanism
If you do make your classes clonable, ensure that your clone method is final and throw super.clone().
MITRE公式ページ — CWE-498