CAPEC-26 - Leveraging Race Conditions

This attack 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 attacker 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 attacker can trick the system by replacing the original file with his version and cause the system to read the malicious file.






  • Attack Methods 2
  • Time and State
  • Modification of Resources
  • Purposes 1
  • Exploitation
  • Scopes 2
  • Gain privileges / assume identity
  • Authorization
  • Access_Control
  • Confidentiality
  • Modify application data
  • Integrity

Medium level:

A resource is accessed/modified concurrently by multiple processes such that a race condition exists.

The attacker has the ability to modify the resource.

Vulnerability testing tool can be used to probe for race condition.

The attacker may also look for temporary file creation. The attacker may tries to replace them and take advantage of a race condition.

Step 1 -

The attacker explores to gauge what level of access he has..

Step 1 -

The attacker gains access to a resource on the target host. The attacker modifies the targeted resource. The resource's value is used to determine the next normal execution action..

Step 1 -

The resource is modified/checked concurrently by multiple processes. By using one of the processes, the attacker is able to modify the value just before it is consumed by a different process. A race condition occurs and is exploited by the Attacker to abuse the target host..

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.