CWE一覧に戻る
CWE-583

finalize() メソッド 宣言パブリック

finalize() Method Declared Public
脆弱性 作成中
JA

この製品は、finalize()メソッドをpublicに宣言することで、モバイルコードのセキュアコーディング原則に違反している。

ただし、finalize()の実装の内部でsuper.finalize()を呼び出す場合を除く。モバイル・コードの状況では、手動でガベージ・コレクションを行うという、そうでなくてもエ ラーを起こしやすい習慣が、パブリック・アクセスで宣言されているために、攻撃者が悪意を持って finalize() メソッドを呼び出すことができれば、セキュリティ上の脅威となる可能性があります。

EN

The product violates secure coding principles for mobile code by declaring a finalize() method public.

A product should never call finalize explicitly, except to call super.finalize() inside an implementation of finalize(). In mobile code situations, the otherwise error prone practice of manual garbage collection can become a security threat if an attacker can maliciously invoke a finalize() method because it is declared with public access.

Scope: Confidentiality, Integrity, Availability / Impact: Alter Execution Logic; Execute Unauthorized Code or Commands; Modify Application Data
If you are using finalize() as it was designed, there is no reason to declare finalize() with anything other than protected access.
MITRE公式ページ — CWE-583