CWEweakness
CWE-663 Use of a Non-reentrant Function in a Concurrent Context
- Abstraction
- Base
- Structure
- Simple
- Status
- Draft
- Languages
- C, Not Language-Specific
- CWE version
- 5.0
Description
The product calls a non-reentrant function in a concurrent context in which a competing code sequence (e.g. thread or signal handler) may have an opportunity to call the same function or otherwise influence its state.
Common consequences
• Integrity, Confidentiality, Other: Modify Memory, Read Memory, Modify Application Data, Read Application Data, Alter Execution Logic
Potential mitigations
• [Implementation] Use reentrant functions if available.
• [Implementation] Add synchronization to your non-reentrant function.
• [Implementation] In Java, use the ReentrantLock Class.
Detection methods
• 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.)
Observed examples
• CVE-2001-1349: unsafe calls to library functions from signal handler
• CVE-2004-2259: SIGCHLD signal to FTP server can cause crash under heavy load while executing non-reentrant functions like malloc/free.
Related
Attack pattern · CAPEC (1)
- CAPEC-29 Leveraging Time-of-Check and Time-of-Use (TOCTOU) Race Conditions attack pattern
Observed example · CVE (2)
- CVE-2004-2259 vsftpd before 1.2.2, when under heavy load, allows attackers to cause a denial of service (crash) via a SIGCHLD signal during a malloc or… vulnerability
- CVE-2001-1349 Sendmail before 8.11.4, and 8.12.0 before 8.12.0.Beta10, allows local users to cause a denial of service and possibly corrupt the heap and… vulnerability
Child of · CWE (1)
- CWE-662 Improper Synchronization weakness
Referenced by CAPEC · weakness (1)
- CAPEC-29 Leveraging Time-of-Check and Time-of-Use (TOCTOU) Race Conditions attack pattern
Referenced by CVE · weakness (1)
- CVE-2026-26201 emp3r0r is a C2 designed by Linux users for Linux environments. vulnerability
Referenced by CWE · child of (2)
Referenced by CWE · peer of (1)
- CWE-1265 Unintended Reentrant Invocation of Non-reentrant Code Via Nested Calls weakness