---
title: "CWE-663: Use of a Non-reentrant Function in a Concurrent Context"
url: https://radicalnotion.ai/cwe/cwe-663
type: cwe
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."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-663: Use of a Non-reentrant Function in a Concurrent Context

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Draft
- **CVEs with this as primary weakness:** 44
- **Of those, in CISA KEV:** 0
- **New in 2026:** 29
- **CWE catalog version:** 4.21

## 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.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | - |

## Applicable platforms

**Languages:** C (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| 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.)

Effectiveness: High

## Demonstrative examples

### Example 1

In this example, a signal handler uses syslog() to log a message:

Bad code:

```c
char *message;
void sh(int dummy) {
    syslog(LOG_NOTICE,"%s\n",message);
    sleep(10);
    exit(0);
}
int main(int argc,char* argv[]) {
    ...
    signal(SIGHUP,sh);
    signal(SIGTERM,sh);
    sleep(10);
    exit(0);
}
If the execution of the first call to the signal handler is suspended after invoking syslog(), and the signal handler is called a second time, the memory allocated by syslog() enters an undefined, and possibly, exploitable state.
```

### Example 2

The following code relies on getlogin() to determine whether or not a user is trusted. It is easily subverted.

Bad code:

```c
pwd = getpwnam(getlogin());
if (isTrustedGroup(pwd->pw_gid)) {
    allow();
} else {
    deny();
}
```

## Observed examples

| CVE | Description |
| --- | --- |
| 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. |

## Real CVEs with this weakness (sample of 12 of 44)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-63865 | bpf: Drop task\_to\_inode and inet\_conn\_established from lsm sleepable hooks | high | 8.8 | - | No | 2026-07-19 |
| CVE-2026-89986 | mm/mempolicy: fix sleeping allocation in alloc\_pages\_bulk\_weighted\_interleave() | high | 7.8 | - | No | 2026-09-16 |
| CVE-2026-74590 | fsverity: Fix bpf\_get\_fsverity\_digest() dynptr assumptions | high | 7.8 | - | No | 2026-08-22 |
| CVE-2026-74338 | bpf: Reject sleepable BPF\_LSM\_CGROUP programs at load time | high | 7.8 | - | No | 2026-08-15 |
| CVE-2023-53860 | dm: don't attempt to queue IO under RCU protection | high | 7.8 | - | No | 2025-12-09 |
| CVE-2025-39804 | lib/crypto: arm64/poly1305: Fix register corruption in no-SIMD contexts | high | 7.8 | - | No | 2025-09-15 |
| CVE-2025-39802 | lib/crypto: arm/poly1305: Fix register corruption in no-SIMD contexts | high | 7.8 | - | No | 2025-09-15 |
| CVE-2026-74750 | ovpn: defer key slot crypto freeing to workqueue | high | 7.5 | - | No | 2026-08-26 |
| CVE-2026-93086 | firmware: arm\_scmi: Avoid IDR updates while cleaning channels | high | 7.1 | - | No | 2026-09-17 |
| CVE-2026-43010 | bpf: Reject sleepable kprobe\_multi programs at attach time | medium | 6.7 | - | No | 2026-05-01 |
| CVE-2025-68260 | rust\_binder: fix race condition on death\_list | medium | 5.8 | - | No | 2025-12-16 |
| CVE-2026-98035 | bpf: Cancel special fields when recycling rhtab elements | medium | 5.5 | - | No | 2026-09-25 |

## Related attack patterns (CAPEC)

- [CAPEC-29](https://radicalnotion.ai/capec/capec-29): Leveraging Time-of-Check and Time-of-Use (TOCTOU) Race Conditions

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-662](https://radicalnotion.ai/cwe/cwe-662) | Improper Synchronization |
| Child | [CWE-479](https://radicalnotion.ai/cwe/cwe-479) | Signal Handler Use of a Non-reentrant Function |
| Child | [CWE-558](https://radicalnotion.ai/cwe/cwe-558) | Use of getlogin() in Multithreaded Application |
| Peer | [CWE-1265](https://radicalnotion.ai/cwe/cwe-1265) | Unintended Reentrant Invocation of Non-reentrant Code Via Nested Calls |

## Frequently asked questions

### What is CWE-663?

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.

### What CVEs are caused by CWE-663?

44 recorded CVEs are attributed to CWE-663, including CVE-2026-63865, CVE-2026-89986 and CVE-2026-74590.

### How do you prevent CWE-663?

Use reentrant functions if available.

### How is CWE-663 detected?

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.)

### What are the consequences of CWE-663?

Exploiting CWE-663 can lead to: Modify Memory, Read Memory, Modify Application Data, Read Application Data, Alter Execution Logic.

### Is CWE-663 actively exploited?

44 recorded CVEs are caused by CWE-663; none are currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/663.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-663). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
