8 lines
840 B
Plaintext
8 lines
840 B
Plaintext
![]() |
"Time Of Check to Time Of Use" (TOCTOU) vulnerabilities occur when an application:
|
||
|
* First, checks permissions or attributes of a file: for instance, is a file a symbolic link?
|
||
|
* Next, performs some operations such as writing data to this file.
|
||
|
|
||
|
The application cannot assume the state of the file is unchanged between these two steps, there is a race condition (ie: two different processes can access and modify the same shared object/file at the same time, which can lead to privilege escalation, denial of service and other unexpected results).
|
||
|
|
||
|
For instance, an attacker can benefit from this situation by creating, just after the first step, a symbolic link to a sensitive file (eg in Unix: <code>/etc/password</code>) and try to elevate his privileges (eg: if the written data has the correct <code>/etc/password</code> file format).
|