Extended Description
Strategy: Language Selection Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.
Design signal handlers to only set flags, rather than perform complex functionality. These flags can then be checked and acted upon within the main program loop.
Only use reentrant functions within signal handlers. Also, use validation to ensure that state is consistent while performing asynchronous actions that affect the state of execution.
No detection method information available for this CWE.
No examples or observed CVEs available for this CWE.
CWE-364: CWE-364: Signal Handler Race Condition is a Common Weakness Enumeration (CWE) entry maintained by MITRE. Description Extended Description
If exploited, CWE-364 (CWE-364: Signal Handler Race Condition) it can compromise Modify Application Data, Modify Memory, DoS: Crash, Exit, or Restart and Execute Unauthorized Code or Commands, leading to outcomes such as Scope: Integrity, Confidentiality, Availability It may be possible to cause data corruption and possibly execute arbitrary code by modifying global variables or data structures at unexpected times, violating the assumptions of code that uses this global data., Scope: Access Control If a signal handler interrupts code that is executing with privileges and it may be possible that the signal handler will also be executed with elevated privileges.
Recommended mitigations for CWE-364 include: Strategy: Language Selection Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. Design signal handlers to only set flags, rather than perform complex functionality. These flags can then be checked and acted upon within the main program loop. Only use reentrant functions within signal handlers. Also, use validation to ensure that state is consistent while performing asynchronous actions that affect the state of execution.
CWE-364 commonly affects Languages. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.
A CWE (Common Weakness Enumeration) like CWE-364 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.