CWE一覧に戻る
CWE-242

本質的に危険な機能の使用

Use of Inherently Dangerous Function
脆弱性 レビュー中
JA

この製品は、安全に動作することを保証できない関数を呼び出している。

ある種の関数は、どのように使われるかに関係なく危険な振る舞いをする。このカテゴリの関数は、セキュリティ上の懸念を考慮せずに実装されていることが多い。gets()関数は入力サイズの境界チェックを行わないので安全ではない。攻撃者は簡単に任意のサイズの入力をgets()に送り、宛先バッファをオーバーフローさせることができる。同様に、>>演算子は入力サイズの境界チェックを行わないため、静的に割り当てられた文字配列に読み込む際に使用するのは安全ではない。攻撃者は簡単に任意のサイズの入力を >> 演算子に送り、宛先バッファをオーバーフローさせることができる。

EN

The product calls a function that can never be guaranteed to work safely.

Certain functions behave in dangerous ways regardless of how they are used. Functions in this category were often implemented without taking security concerns into account. The gets() function is unsafe because it does not perform bounds checking on the size of its input. An attacker can easily send arbitrarily-sized input to gets() and overflow the destination buffer. Similarly, the >> operator is unsafe to use when reading into a statically-allocated character array because it does not perform bounds checking on the size of its input. An attacker can easily send arbitrarily-sized input to the >> operator and overflow the destination buffer.

Scope: Other / Impact: Varies by Context
Ban the use of dangerous functions. Use their safe equivalent.
Use grep or static analysis tools to spot usage of dangerous functions.
MITRE公式ページ — CWE-242