Dark Mode

Settings

Capec-26 Detail

Leveraging Race Conditions

Meta Software Hardware Likelihood: High Typical Severity: High

Children: 29

Threats: T79 T287 T337 T391 T406

Description

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.

Not present

External ID Source Link Description
CAPEC-26 capec https://capec.mitre.org/data/definitions/26.html
CWE-368 cwe http://cwe.mitre.org/data/definitions/368.html
CWE-363 cwe http://cwe.mitre.org/data/definitions/363.html
CWE-366 cwe http://cwe.mitre.org/data/definitions/366.html
CWE-370 cwe http://cwe.mitre.org/data/definitions/370.html
CWE-362 cwe http://cwe.mitre.org/data/definitions/362.html
CWE-662 cwe http://cwe.mitre.org/data/definitions/662.html
CWE-689 cwe http://cwe.mitre.org/data/definitions/689.html
CWE-667 cwe http://cwe.mitre.org/data/definitions/667.html
CWE-665 cwe http://cwe.mitre.org/data/definitions/665.html
CWE-1223 cwe http://cwe.mitre.org/data/definitions/1223.html
CWE-1254 cwe http://cwe.mitre.org/data/definitions/1254.html
CWE-1298 cwe http://cwe.mitre.org/data/definitions/1298.html
REF-1 reference_from_CAPEC G. Hoglund, G. McGraw, Exploiting Software: How to Break Code, 2004--02, Addison-Wesley
REF-105 reference_from_CAPEC http://en.wikipedia.org/wiki/Race_condition Wikipedia, The Wikimedia Foundation, Inc
REF-106 reference_from_CAPEC http://www.ibm.com/developerworks/linux/library/l-sprace/index.html David Wheeler, Secure programmer: Prevent race conditions, IBM developerWorks, IBM
REF-107 reference_from_CAPEC http://samate.nist.gov/SRD/view_testcase.php?tID=1598 Fortify Software, SAMATE - Software Assurance Metrics And Tool Evaluation, 2006--06---22, National Institute of Standards and Technology (NIST)
Explore
  1. The adversary explores to gauge what level of access they have.

Experiment
  1. 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
  1. 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.

  1. A resource is accessed/modified concurrently by multiple processes such that a race condition exists.
  2. The adversary has the ability to modify the resource.

Not present

Medium
Being able to "run the race" requires basic knowledge of concurrent processing including synchonization techniques.
Integrity Authorization Access Control Confidentiality
Modify Data Gain Privileges Gain Privileges Gain Privileges
  1. 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
  2. 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 include include 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; }