CWE-479: Signal Handler Use of a Non-reentrant Function

VariantDraftExploit Likelihood: Low

The product defines a signal handler that calls a non-reentrant function.

View on MITRE
Back to CWE Lookup

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.

Technical Details

Structure
Simple
Vulnerability Mapping
ALLOWED

Applicable To

Languages
CC++
Platforms

Source-backed guidance

Additional facts reviewed against primary or authoritative security sources.

Verify controls for CWE-479 with SSDF evidence

Use NIST SSDF verification and vulnerability-response practices to detect CWE-479, Signal Handler Use of a Non-reentrant Function, throughout the product lifecycle. Derive review questions, static or dynamic checks, and negative tests from the CWE's causal behavior; define the components and lifecycle stages each check covers; and retain findings with enough evidence to distinguish the root cause from symptoms and impacts. Track escapes and false negatives, then improve the verification plan after every confirmed occurrence.

NIST SP 800-218 Secure Software Development FrameworkNational Institute of Standards and Technology

Address Signal Handler Use of a Non-reentrant Function during Requirements

MITRE associates mitigation with Requirements, Architecture and Design, and Implementation; documented detection approaches include Automated Static Analysis; recorded impacts include Execute Unauthorized Code or Commands, Modify Memory, and Modify Application Data. Use these source-defined anchors to turn CWE-479 into implementation, review, and verification checks for the affected component.

CWE-479: Signal Handler Use of a Non-reentrant FunctionMITRE CWE

Triage CWE-479 against known exploitation evidence

Use CISA's Known Exploited Vulnerabilities catalog to test whether a vulnerability mapped to CWE-479, Signal Handler Use of a Non-reentrant Function, has evidence of exploitation in the wild. Confirm the CVE-to-CWE root-cause mapping independently before attaching the example, then capture the affected product, required action, and remediation deadline. A missing KEV match is not evidence that the weakness is unexploited, and a KEV entry must not be generalized to every occurrence of this CWE.

Known Exploited Vulnerabilities CatalogCybersecurity and Infrastructure Security Agency

Apply precise root-cause mapping to CWE-479

Apply MITRE's full root-cause mapping guidance when using CWE-479, Signal Handler Use of a Non-reentrant Function. Separate weakness language from attacker prerequisites and technical impact, check the entry's abstraction and vulnerability-mapping notes, and prefer the most specific Base or Variant supported by the evidence. Record the rejected alternatives and require an independent review before the mapping is used for remediation trends or program metrics.

CVE to CWE Root Cause Mapping GuidanceMITRE CWE

Validate CWE-479 with root-cause mapping checks

Apply MITRE's root-cause mapping quick tips to CWE-479, Signal Handler Use of a Non-reentrant Function. Confirm the finding describes the causal weakness rather than an impact or attack pattern, compare the abstraction and mapping notes with plausible alternatives, and have a second reviewer challenge the selection. Preserve the evidence and reasoning so recurring defects can be measured against one consistent identifier.

CVE to CWE Root Cause Mapping Quick TipsMITRE CWE

Frequently Asked Questions

What is CWE-479: Signal Handler Use of a Non-reentrant Function?+

CWE-479: Signal Handler Use of a Non-reentrant Function is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The product defines a signal handler that calls a non-reentrant function. 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.

What are the security consequences of Signal Handler Use of a Non-reentrant Function?+

If exploited, CWE-479 (Signal Handler Use of a Non-reentrant Function) it can compromise Integrity, Confidentiality and Availability, leading to outcomes such as Execute Unauthorized Code or Commands, Modify Memory and Modify Application Data.

How do you prevent or mitigate Signal Handler Use of a Non-reentrant Function?+

Recommended mitigations for CWE-479 include: Require languages or libraries that provide reentrant functionality, or otherwise make it easier to avoid this weakness. Design signal handlers to only set flags rather than perform complex functionality. Ensure that non-reentrant functions are not found in signal handlers.

Which programming languages are affected by Signal Handler Use of a Non-reentrant Function?+

CWE-479 commonly affects C and C++. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.

What are real-world examples of Signal Handler Use of a Non-reentrant Function?+

MITRE documents real CVEs mapped to CWE-479, including CVE-2005-0893 and CVE-2004-2259. You can look up the full details of each CVE, including CVSS scores and remediation guidance, on our CVE Lookup tool.

What is the difference between a CWE and a CVE?+

A CWE (Common Weakness Enumeration) like CWE-479 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.

Learn More

Advertisement
CWE-479: Signal Handler Use of a Non-reentrant Function | CWE Lookup | InventiveHQ