CWE一覧に戻る
CWE-831

複数の信号に関連するシグナルハンドラ関数

Signal Handler Function Associated with Multiple Signals
脆弱性 作成中
JA

この製品は、複数のシグナルのハンドラーとして使用される関数を定義している。

意図的で安全な場合もあるが、同じ関数が複数のシグナルを処理するために使われる場合、グローバル変数や再入可能でない関数など、ローカル宣言以外の状態を関数が使用したり、副作用があったりすると、レースコンディションが発生する可能性がある。

攻撃者は、ハンドラ関数を呼び出すシグナルを送信することができます。多くのOSでは、少なくともハンドラ関数の実行が完了するまでは、同じシグナルが再びハンドラを呼び出すことはありません。しかし、攻撃者は同じハンドラ関数に関連する別のシグナルを送ることができる。これにより、元のハンドラー関数がまだ実行されている間に、そのハンドラー関数を中断させることができる。共有ステートがある場合、そのステートは破損する可能性がある。これは、コンテキストに応じて、サービス拒否やコード実行を含む様々な潜在的な結果につながる可能性がある。

また、シグナルハンドラが(もし実行されるとしても)一度しか実行されないように設計されている場合にも、めったに調査されることのない可能性が生じます。複数のシグナルを送ることで、攻撃者は関数を複数回呼び出すことができます。これにより、意図しない副作用が発生する可能性があります。攻撃者は1つのシグナルを送り、それが処理されるまで待ち、それからもう1つのシグナルを送ることができる。

EN

The product defines a function that is used as a handler for more than one signal.

While sometimes intentional and safe, when the same function is used to handle multiple signals, a race condition could occur if the function uses any state outside of its local declaration, such as global variables or non-reentrant functions, or has any side effects.

An attacker could send one signal that invokes the handler function; in many OSes, this will typically prevent the same signal from invoking the handler again, at least until the handler function has completed execution. However, the attacker could then send a different signal that is associated with the same handler function. This could interrupt the original handler function while it is still executing. If there is shared state, then the state could be corrupted. This can lead to a variety of potential consequences depending on context, including denial of service and code execution.

Another rarely-explored possibility arises when the signal handler is only designed to be executed once (if at all). By sending multiple signals, an attacker could invoke the function more than once. This may generate extra, unintended side effects. A race condition might not even be necessary; the attacker could send one signal, wait until it is handled, then send the other signal.

Scope: Availability, Integrity, Confidentiality, Access Control, Other / Impact: DoS: Crash, Exit, or Restart; Execute Unauthorized Code or Commands; Read Application Data; Gain Privileges or Assume Identity; Bypass Protection Mechanism; Varies by Context
MITRE公式ページ — CWE-831