CWE一覧に戻る
CWE-244

リリース前のヒープメモリの不適切なクリア(「ヒープ検査)

Improper Clearing of Heap Memory Before Release ('Heap Inspection')
脆弱性 レビュー中
JA

realloc()を使用して機密情報を格納するバッファのサイズを変更すると、機密情報がメモリから削除されないため、攻撃にさらされる可能性がある。

パスワードや暗号化キーのような機密データがメモリから削除されていない場合、メモリ・ダンプやその他の方法を使用して機密データを読み取る「ヒープ検査」攻撃を使用する攻撃者に、機密データが公開される可能性がある。realloc()関数は、割り当てられたメモリ・ブロックのサイズを増やすためによく使われる。この操作では多くの場合、古いメモリ・ブロックの内容を新しいより大きなブロックにコピーする必要がある。この操作では、元のブロックの内容はそのまま残りますが、プログラムからはアクセスできないため、プログラムがメモリから機密データをスクラブすることはできません。もし攻撃者が後でメモリーダンプの内容を調べることができれば、機密データが暴露される可能性がある。

EN

Using realloc() to resize buffers that store sensitive information can leave the sensitive information exposed to attack, because it is not removed from memory.

When sensitive data such as a password or an encryption key is not removed from memory, it could be exposed to an attacker using a "heap inspection" attack that reads the sensitive data using memory dumps or other methods. The realloc() function is commonly used to increase the size of a block of allocated memory. This operation often requires copying the contents of the old memory block into a new and larger block. This operation leaves the contents of the original block intact but inaccessible to the program, preventing the program from being able to scrub sensitive data from memory. If an attacker can later examine the contents of a memory dump, the sensitive data could be exposed.

Scope: Confidentiality, Other / Impact: Read Memory; Other
MITRE公式ページ — CWE-244