Umbra Wiki weakness weakness/CWE-663
Back to wiki

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

provenance: imported · CWE: CWE-663

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