引入方式
Implementation
適用平台
程式語言
類別: Not Language-Specific (Undetermined)
名稱: C (Undetermined)
常見後果
| 範圍 |
影響 |
可能性 |
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. | |
觀察到的案例
| 參考資料 |
描述 |
| Signal handler uses functions that ultimately call the unsafe syslog/malloc/s*printf, leading to denial of service via multiple login attempts |
| Chain: Signal handler contains too much functionality (CWE-828), introducing a race condition (CWE-362) that leads to a double free (CWE-415). |
| unsafe calls to library functions from signal handler |
| SIGURG can be used to remotely interrupt signal handler; other variants exist. |
| SIGCHLD signal to FTP server can cause crash under heavy load while executing non-reentrant functions like malloc/free. |
| SIGCHLD not blocked in a daemon loop while counter is modified, causing counter to get out of sync. |
潛在緩解措施
Phases : Implementation // Architecture and Design
Phases : 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.
偵測方法
Automated Static Analysis
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
漏洞對應備注
理由說明 : This CWE entry is at the Variant level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
備註 : Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.
參考資料
REF-360
Delivering Signals for Fun and Profit
Michal Zalewski.
https://lcamtuf.coredump.cx/signals.txt REF-361
Race Condition: Signal Handling
https://vulncat.fortify.com/en/detail?id=desc.structural.cpp.race_condition_signal_handling#:~:text=Signal%20handling%20race%20conditions%20can,installed%20to%20handle%20multiple%20signals.s
提交
| 名稱 |
機構 |
日期 |
發布日期 |
Version |
| CWE Content Team |
MITRE |
2010-11-08 +00:00 |
2010-12-13 +00:00 |
1.11 |
修改記錄
| 名稱 |
機構 |
日期 |
備註 |
| CWE Content Team |
MITRE |
2011-06-01 +00:00 |
updated Common_Consequences |
| CWE Content Team |
MITRE |
2012-05-11 +00:00 |
updated Demonstrative_Examples |
| CWE Content Team |
MITRE |
2014-06-23 +00:00 |
updated Demonstrative_Examples, References |
| CWE Content Team |
MITRE |
2017-11-08 +00:00 |
updated Observed_Examples |
| CWE Content Team |
MITRE |
2020-02-24 +00:00 |
updated Relationships |
| CWE Content Team |
MITRE |
2021-03-15 +00:00 |
updated Demonstrative_Examples |
| CWE Content Team |
MITRE |
2022-04-28 +00:00 |
updated Observed_Examples |
| CWE Content Team |
MITRE |
2023-01-31 +00:00 |
updated Common_Consequences, Description, Potential_Mitigations |
| CWE Content Team |
MITRE |
2023-04-27 +00:00 |
updated References, Relationships, Type |
| CWE Content Team |
MITRE |
2023-06-29 +00:00 |
updated Mapping_Notes |
| CWE Content Team |
MITRE |
2025-12-11 +00:00 |
updated Applicable_Platforms, Detection_Factors, Time_of_Introduction, Weakness_Ordinalities |