CWE-479
Signal Handler Use of a Non-reentrant Function
Extended description
Non-reentrant functions are functions that cannot safely be called, interrupted, and then recalled before the first call has finished without resulting in memory corruption. This can lead to an unexpected system state and unpredictable results with a variety of potential consequences depending on context, including denial of service and code execution. Many functions are not reentrant, but some of them can result in the corruption of memory if they are used in a signal handler. The function call syslog() is an example of this. In order to perform its functionality, it allocates a small amount of memory as "scratch space." If syslog() is suspended by a signal call and the signal handler calls syslog(), the memory used by both of these functions enters an undefined, and possibly, exploitable state. Implementations of malloc() and free() manage metadata in global structures in order to track which memory is allocated versus which memory is available, but they are non-reentrant. Simultaneous calls to these functions can cause corruption of the metadata.
Common consequences2
- IntegrityConfidentialityAvailabilityExecute Unauthorized Code or Commands
It may be possible to execute arbitrary code through the use of a write-what-where condition.
- IntegrityModify MemoryModify Application Data
Signal race conditions often result in data corruption.
Potential mitigations4
- Requirements
Require languages or libraries that provide reentrant functionality, or otherwise make it easier to avoid this weakness.
- Architecture and Design
Design signal handlers to only set flags rather than perform complex functionality.
- Implementation
Ensure that non-reentrant functions are not found in signal handlers.
- ImplementationDefense in Depth
Use sanity checks to reduce the timing window for exploitation of race conditions. This is only a partial solution, since many attacks might fail, but other attacks still might work within the narrower window, even accidentally.
CVEs referencing this CWE2
| CVE | Description | Severity | EPSS | Flags | Modified |
|---|---|---|---|---|---|
| CVE-2021-26948 | Null pointer dereference in the htmldoc v1.9.11 and before may allow attackers to execute arbitrary code and cause a denial of service via a crafted html file. | HIGH7.8 | 0.84%p54 | 2026-06-17 | |
| CVE-2026-44011 | Craft CMS is a content management system (CMS). From 4.0.0 to before 4.17.12 and 5.9.18, Craft CMS which contains an input-handling flaw in a Yii object creation path that let any authenticated user inject malicious configuration and execute arbitrary commands on the server. The request-controlled condition field layouts data is converted into a live FieldLayout object without a Component::cleanseConfig() boundary. Because Craft configures models before parent::__construct(), attacker-controlled special config keys can take effect during object creation, and FieldLayout initialization then triggers a same-request event. This vulnerability is fixed in 4.17.12 and 5.9.18. | NONE | 0.36%p29 | 2026-06-17 |