CWE-663 — Use of a Non-reentrant Function in a Concurrent Context
CWE-663: Use of a Non-reentrant Function in a Concurrent Context
MITRE CWE weakness
| Kind | Weakness |
| Abstraction | Base |
| Status | Draft |
| Likelihood of exploit | — |
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
Mitigations
Implementation — Use reentrant functions if available.
Implementation — Add synchronization to your non-reentrant function.
Implementation — In Java, use the ReentrantLock Class.
References
- CWE page: https://cwe.mitre.org/data/definitions/663.html
- CWE list: https://cwe.mitre.org/data/index.html