This attack targets a race condition occurring between the time of check
(state) for a resource and the time of use of a resource. The typical
example is the file access. The attacker can leverage a file access race
condition by "running the race", meaning that he would modify the resource
between the first time the target program accesses the file and the time the
target program uses the file. During that period of time, the attacker could
do something such as replace the file and cause an escalation of
privilege.
Attack Execution Flow
The attacker explores to gauge what level of
access he has.
The attacker confirms access to a resource on the
target host. The attacker confirms ability to modify
the targeted resource.
The attacker decides to leverage the race
condition by "running the race", meaning that he
would modify the resource between the first time the
target program accesses the file and the time the
target program uses the file. During that period of
time, the attacker can replace the resource and
cause an escalation of privilege.
Attack Prerequisites
A resource is access/modified concurrently by multiple processes.
The attacker is able to modify resource.
A race condition exists while accessing a resource.
Typical Likelihood of Exploit
Likelihood: High
Methods of Attack
Time and State
Modification of Resources
Examples-Instances
Description
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.
Related Vulnerabilities
CVE-2007-1057
Description
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.