1 vulnerabilities classified as CWE-828 (非异步安全功能中的信号处理例程). AI Chinese analysis included.
CWE-828 represents a critical implementation flaw where signal handlers invoke functions that are not asynchronous-safe, meaning they lack reentrancy or cannot be safely interrupted during execution. This weakness typically arises when developers use non-thread-safe library calls, such as printf or malloc, within a handler context. Exploitation often occurs when a signal interrupts a vulnerable operation, causing race conditions, memory corruption, or undefined behavior that can lead to denial of service or arbitrary code execution. To mitigate this risk, developers must strictly adhere to asynchronous-signal-safe functions defined by POSIX standards within their handlers. By limiting handler logic to simple state flags or using sig_atomic_t variables, programmers ensure that signal processing does not interfere with ongoing critical operations, thereby maintaining system stability and preventing unexpected state transitions.
char *logMessage; void handler (int sigNum) { syslog(LOG_NOTICE, "%s\n", logMessage); free(logMessage); /* artificially increase the size of the timing window to make demonstration of this weakness easier. */ sleep(10); exit(0); } int main (int argc, char* argv[]) { logMessage = strdup(argv[1]); /* Register signal handlers. */ signal(SIGHUP, handler); signal(SIGTERM, handler); /* artificially increase the size of the timing window to make demonstration of this weakness easier. */ sleep(10); }#include <signal.h> #include <syslog.h> #include <string.h> #include <stdlib.h> void *global1, *global2; char *what; void sh (int dummy) { syslog(LOG_NOTICE,"%s\n",what); free(global2); free(global1); /* Sleep statements added to expand timing window for race condition */ sleep(10); exit(0); } int main (int argc,char* argv[]) { what=argv[1]; global1=strdup(argv[2]); global2=malloc(340); signal(SIGHUP,sh); signal(SIGTERM,sh); /* Sleep statements added to expand timing window for race condition */ sleep(10); exit(0); }| CVE ID | Title | CVSS | Severity | Published |
|---|---|---|---|---|
| CVE-2024-20309 | Cisco IOS XE Software 安全漏洞 — Cisco IOS XE Software | 5.6 | Medium | 2024-03-27 |
Vulnerabilities classified as CWE-828 (非异步安全功能中的信号处理例程) represent 1 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.