Katalog CWE

CWE-366 · Słabość

Race Condition within a Thread

Abstrakcja
Bazowa
Status
Szkic
Ryzyko wykorzystania
średnie
Dodano
19 lipca 2006
Ostatnia zmiana
11 grudnia 2025

Podatności CVE z tą słabościąPełny wpis na cwe.mitre.org ↗

Opis

If two threads of execution use a resource simultaneously, there exists the possibility that resources may be used while invalid, in turn making the state of execution undefined.

Skutki

  • Integrity, Other

    Alter Execution Logic; Unexpected State

    The main problem is that -- if a lock is overcome -- data could be altered in a bad state.

Zapobieganie

  • Architecture and Design

    Use locking functionality. This is the recommended solution. Implement some form of locking mechanism around code which alters or reads persistent data in a multithreaded environment.

  • Architecture and Design

    Create resource-locking validation checks. If no inherent locking mechanisms exist, use flags and signals to enforce your own blocking scheme when resources are being used by other threads of execution.

Przykłady podatności

Słabość nadrzędna

Kiedy powstaje

Dotyczy

C, C++, Java, C#, Not Technology-Specific

Źródła

  1. The CLASP Application Security Process — Secure Software, Inc., 2005
  2. 24 Deadly Sins of Software Security — Michael Howard, David LeBlanc, John Viega, "Sin 13: Race Conditions." Page 205, McGraw-Hill, 2010
  3. The Art of Software Security Assessment — Mark Dowd, John McDonald, Justin Schuh, Chapter 13, "Race Conditions", Page 759, Addison Wesley, 2006

Wpis z katalogu CWE 4.20.