CAPEC-26
Leveraging Race Conditions
The adversary targets a race condition occurring when multiple processes access and manipulate the same resource concurrently, and the outcome of the execution depends on the particular order in which the access takes place. The adversary can leverage a race condition by "running the race", modifying the resource and modifying the normal execution flow. For instance, a race condition can occur while accessing a file: the adversary can trick the system by replacing the original file with their version and cause the system to read the malicious file.
On this page
Ask an AI about this attack pattern
Show the prompt
Explain the attack pattern CAPEC-26: Leveraging Race Conditions: how it unfolds, what it needs and how to prevent and detect it in my systems. Use https://capec.mitre.org/data/definitions/26.html and https://cve.bz/cve/capec/26?via=ask-ai-copy, which lists recent CVEs with the weaknesses it exploits. Cite the sources.Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this attack pattern's id and public links.
How the attack unfolds
Explore
The attacker looks for a way in.
The adversary explores to gauge what level of access they have.
Experiment
They probe what they found.
The adversary gains access to a resource on the target host. The adversary modifies the targeted resource. The resource's value is used to determine the next normal execution action.
Exploit
They carry out the attack.
The resource is modified/checked concurrently by multiple processes. By using one of the processes, the adversary is able to modify the value just before it is consumed by a different process. A race condition occurs and is exploited by the adversary to abuse the target host.
Prerequisites
A resource is accessed/modified concurrently by multiple processes such that a race condition exists.
The adversary has the ability to modify the resource.
Skills required
- Medium skill
Being able to "run the race" requires basic knowledge of concurrent processing including synchonization techniques.
Consequences
| Impact | Affects | Note |
|---|---|---|
| Gain Privileges | Confidentiality, Access Control, Authorization | |
| Modify Data | Integrity |
Mitigations
Use safe libraries to access resources such as files.
Be aware that improper use of access function calls such as chown(), tempfile(), chmod(), etc. can cause a race condition.
Use synchronization to control the flow of execution.
Use static analysis tools to find race conditions.
Pay attention to concurrency problems related to the access of resources.
Weaknesses it exploits
- CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization
- CWE-363 Race Condition Enabling Link Following
- CWE-366 Race Condition within a Thread
- CWE-368 Context Switching Race Condition
- CWE-370 Missing Check for Certificate Revocation after Initial Check
- CWE-662 Improper Synchronization
- CWE-665 Improper Initialization
- CWE-667 Improper Locking
- CWE-689 Permission Race Condition During Resource Copy
- CWE-1223 Race Condition for Write-Once Attributes
- CWE-1254 Incorrect Comparison Logic Granularity
- CWE-1298 Hardware Logic Contains Race Conditions
Recent CVEs with these weaknesses
- 5.3CVE-2026-119011
DoS vulnerability in the DSoftBus module. Impact: Successful exploitation of this vulnerability will affect availability.
- 5.9CVE-2026-119007
Race condition vulnerability in the location service module. Impact: Successful exploitation of this vulnerability will affect availability.
- 5.3CVE-2026-119010
Race condition vulnerability in the DSoftBus module. Impact: Successful exploitation of this vulnerability will affect availability.
- 5.7CVE-2026-140039
A flaw was found in libproxy. When Proxy Auto-Configuration (PAC) or Web Proxy Auto-Discovery (WPAD) is enabled, libproxy holds an internal lock while synchronously downloading and executing PAC scripts. An attacker able to influence the p…
- 5.9CVE-2026-102961
Zephyr's IPv6, IPv4 and IEEE 802.15.4 (6LoWPAN) fragment reassembly implementations each keep a global reassembly cache that two threads modify with no synchronization. In the IPv6 code in subsys/net/ip/ipv6_fragment.c, the receive path ru…
- 6.7CVE-2026-81053
Dell Secure Connect Gateway - Virtual Edition, versions prior to 5.36.00.16, contains a Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') vulnerability. A low privileged remote attacker could poten…
- 5.3CVE-2026-80504
Dell Secure Connect Gateway - Virtual Edition, versions prior to 5.36.00.16, contains a Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') vulnerability. A low privileged local attacker could potent…
- 5.7CVE-2026-137743
A weakness has been identified in Free5GC up to 4.2.3. Affected by this vulnerability is an unknown functionality of the file internal/sbi/processor/subs_to_notify_collection.go of the component UDR. Executing a manipulation can lead to ra…
The newest records naming one of them. Each weakness's page lists them all.
Related attack patterns
- More specific patterns
- CAPEC-29 Leveraging Time-of-Check and Time-of-Use (TOCTOU) Race Conditions
Examples
The Net Direct client for Linux before 6.0.5 in Nortel Application Switch 2424, VPN 3050 and 3070, and SSL VP…
The Net Direct client for Linux before 6.0.5 in Nortel Application Switch 2424, VPN 3050 and 3070, and SSL VPN Module 1000 extracts and executes files with insecure permissions, which allows local users to exploit a race condition to replace a world-writable file in /tmp/NetClient and cause another user to execute arbitrary code when attempting to execute this client, as demonstrated by replacing /tmp/NetClient/client. See also: CVE-2007-1057
The following code illustrates a file that is accessed multiple times by name in a publicly accessible direct…
The following code illustrates a file that is accessed multiple times by name in a publicly accessible directory. A race condition exists between the accesses where an attacker can replace the file referenced by the name (see [REF-107]).
include<sys/types.h>
include<fcntl.h>
include<unistd.h>
define FILE "/tmp/myfile"
define UID 100
void test(char *str)
{
int fd;
fd = creat(FILE, 0644);
if(fd == -1)
return;
chown(FILE, UID, -1); /* BAD */
close(fd);
}
int main(int argc, char **argv)
{
char *userstr;
if(argc>1) {
userstr = argv[1];
test(userstr);
}
return 0;
}MITRE's words, unchanged: CAPEC-26 at MITRE. CAPEC is Copyright © 2007–2026, The MITRE Corporation, used under the CAPEC terms of use: “The MITRE Corporation (MITRE) hereby grants you a non-exclusive, royalty-free license to use Common Attack Pattern Enumeration and Classification (CAPEC™) for research, development, and commercial purposes. Any copy you make for such purposes is authorized provided that you reproduce MITRE’s copyright designation and this license in any such copy.” CAPEC and the CAPEC logo are trademarks of The MITRE Corporation. Credits. All attack patterns.