Threats, Vulnerabilities, and Attacks

An application confirms that a user may write to a file and writes to it milliseconds later. An attacker swaps the file in between. Which event is the time of check?

Show the answer

Correct answerC. The permission verification before the write

AWhy not this: The swap is the attacker's action inside the gap, not the application's check.

BWhy not this: Launching the application is unrelated to the verify-then-act sequence that creates the race.

CWhy this is right: The check validates a condition, the permission, and the result can go stale before the file is used.

DWhy not this: The write is when the checked result is acted on, which is the time of use, not the check.

Time of check is the moment the application verifies a condition, here the user's write permission. The write is the time of use, when the application acts on the earlier result. The attacker exploits the gap between the two.