CWE-828: Signal Handler with Functionality that is not Asynchronous-Safe

Variant Incomplete Simple

CWE版本: 4.18

更新日期: 2025-09-09

弱点描述

The product defines a signal handler that contains code sequences that are not asynchronous-safe, i.e., the functionality is not reentrant, or it can be interrupted.

常见后果

影响范围: Integrity Confidentiality Availability

技术影响: DoS: Crash, Exit, or Restart Execute Unauthorized Code or Commands

说明: The most common consequence will be a corruption of the state of the product, possibly leading to a crash or exit. However, if the signal handler is operating on state variables for security relevant libraries or protection mechanisms, the consequences can be far more severe, including protection mechanism bypass, privilege escalation, or information exposure.

潜在缓解措施

阶段: Implementation Architecture and Design

有效性: High

阶段: Implementation

描述: Where non-reentrant functionality must be leveraged within a signal handler, be sure to block or mask signals appropriately. This includes blocking other signals within the signal handler itself that may also leverage the functionality. It also includes blocking all signals reliant upon the functionality when it is being accessed or modified by the normal behaviors of the product.

观察示例

参考: CVE-2008-4109

Signal handler uses functions that ultimately call the unsafe syslog/malloc/s*printf, leading to denial of service via multiple login attempts

参考: CVE-2006-5051

Chain: Signal handler contains too much functionality (CWE-828), introducing a race condition (CWE-362) that leads to a double free (CWE-415).

参考: CVE-2001-1349

unsafe calls to library functions from signal handler

参考: CVE-2004-0794

SIGURG can be used to remotely interrupt signal handler; other variants exist.

参考: CVE-2004-2259

SIGCHLD signal to FTP server can cause crash under heavy load while executing non-reentrant functions like malloc/free.

参考: CVE-2002-1563

SIGCHLD not blocked in a daemon loop while counter is modified, causing counter to get out of sync.

分类映射

分类名称 条目ID 条目名称 映射适配度
CERT C Secure Coding SIG31-C Do not access or modify shared objects in signal handlers -
关键信息

CWE ID: CWE-828

抽象级别: Variant

结构: Simple

状态: Incomplete

相关弱点