CWE-828 非异步安全功能中的信号处理例程 类弱点 1 条 CVE 漏洞汇总,含 AI 中文分析。
CWE-828 指信号处理函数包含非异步安全代码,如非重入或可被中断的逻辑。攻击者可通过构造特定信号触发竞态条件,导致系统状态异常,进而引发拒绝服务或远程代码执行。开发者应避免在信号处理程序中调用非异步安全函数,确保处理逻辑简洁且线程安全,从而防止不可预期的系统崩溃或恶意利用。
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 | 标题 | CVSS | 风险等级 | Published |
|---|---|---|---|---|
| CVE-2024-20309 | Cisco IOS XE Software 安全漏洞 — Cisco IOS XE Software | 5.6 | Medium | 2024-03-27 |
CWE-828(非异步安全功能中的信号处理例程) 是常见的弱点类别,本平台收录该类弱点关联的 1 条 CVE 漏洞。