CWE一覧に戻る
CWE-374

信頼できないメソッドに変更可能オブジェクトを渡す

Passing Mutable Objects to an Untrusted Method
脆弱性 レビュー中
JA

この製品は、クローン化されていないミュータブル・データをメソッドや関数の引数として送る。

呼び出された関数やメソッドは、変更可能なデータを変更したり削除したりすることができる。これは、呼び出された関数がその状態について設定した仮定に違反する可能性がある。ミュータブル・データへの参照を持つ未知のコードが呼び出された場合、この外部コードが送信されたデータに変更を加える可能性がある。このデータが以前にクローン化されていない場合、変更されたデータは実行時のコンテキストでは有効でないかもしれない。

EN

The product sends non-cloned mutable data as an argument to a method or function.

The function or method that has been called can alter or delete the mutable data. This could violate assumptions that the calling function has made about its state. In situations where unknown code is called with references to mutable data, this external code could make changes to the data sent. If this data was not previously cloned, the modified data might not be valid in the context of execution.

Scope: Integrity / Impact: Modify Memory
Pass in data which should not be altered as constant or immutable.
Clone all mutable data before passing it into an external function . This is the preferred mitigation. This way, regardless of what changes are made to the data, a valid copy is retained for use by the class.
MITRE公式ページ — CWE-374