August 13, 2026
Race Conditions Real-World Examples
Security+ Studies Domain 2 — Threats, Vulnerabilities and Mitigations
By Marcello P.
1 min read
1. The Starbucks E-Commerce Double-Spend (Web Application)
This scenario directly mirrors the Time-of-Check to Time-of-Use (TOCTOU) gift card graphic we just reviewed.
- The Incident: In 2015, security researcher Egor Homakov discovered a severe race condition vulnerability within the Starbucks gift card processing system.
- The Method: Homakov purchased multiple Starbucks gift cards, each loaded with a standard balance of $5. He then began transferring the funds from the first card onto the second card twice.
- The Exploit: By sending concurrent transfer requests, he exploited a TOCTOU window that was too large. The Starbucks server processed both transfer threads simultaneously without proper synchronization. The logic checked the balance, saw the valid funds, and applied the credit to the second card multiple times before the database could accurately update the first card's balance to zero. He successfully proved the concept by purchasing items in-store with the artificially generated balance.
2. "Dirty COW" (Linux Kernel Vulnerability)
This is one of the most famous privilege escalation race conditions in history, officially tracked in the Common Vulnerabilities and Exposures database as CVE-2016–5195.
- The Incident: Discovered in 2016, this race condition flaw existed silently in the Linux kernel for nine years.
- The Threat Actors: Various cybercriminal groups quickly weaponized this flaw. It was notably utilized by developers of the ZNIU malware family to mass-compromise Android devices, as well as attackers targeting enterprise Linux servers.
- The Method: The vulnerability lived inside the kernel functions that handled the copy-on-write (COW) feature of memory mappings. Writing to a physical address consisted of two non-atomic actions.
- The Exploit: Attackers forced a race condition by having one thread attempt to write to memory, while simultaneously using a second thread to tell the kernel to throw away the private copy. By getting "right in the middle" of the process, the attacker tricked the kernel into accidentally writing to an original read-only file. This allowed local attackers to overwrite critical system files — like the /etc/passwd file — to instantly escalate their privileges to root.
Exam Takeaway:
For the SY0–701 exam, remember that race conditions (CWE-362) happen when a program's behavior depends on the uncontrolled sequence of concurrent events. Whether it is a web application incorrectly handling a gift card balance or an operating system mishandling memory threads, the core vulnerability is always a failure to properly synchronize access to a shared resource.