CAS-003 · Question #332
A security analyst is inspecting pseudocode of the following multithreaded application: 1. perform daily ETL of data 1.1 validate that yesterday's data model file exists 1.2 validate that today's…
The correct answer is A. Time of check/time of use. The pseudocode reveals a TOCTOU (Time of Check/Time of Use) vulnerability where file existence is validated before use, but in a multithreaded context another thread could alter that state between the check and the actual operation.
Question
Options
- ATime of check/time of use
- BResource exhaustion
- CImproper storage of sensitive data
- DPrivilege escalation
How the community answered
(32 responses)- A56% (18)
- B6% (2)
- C22% (7)
- D16% (5)
Why each option
The pseudocode reveals a TOCTOU (Time of Check/Time of Use) vulnerability where file existence is validated before use, but in a multithreaded context another thread could alter that state between the check and the actual operation.
In a multithreaded application, the gap between validating file existence (steps 1.1-1.2) and actually operating on those files (steps 1.3-1.5) creates a race condition window. A concurrent thread could create, delete, or modify the data model files after the checks pass but before the ETL steps complete, enabling unpredictable behavior or exploitation. This is the canonical definition of a TOCTOU vulnerability.
Resource exhaustion involves depleting system resources such as memory or CPU cycles, which is not demonstrated anywhere in this sequential file-based ETL workflow.
Improper storage of sensitive data would involve writing data to insecure or unencrypted locations, a concern the pseudocode does not illustrate.
Privilege escalation involves gaining higher access rights than authorized, which is absent from this workflow that simply reads, transforms, and writes data model files.
Concept tested: TOCTOU race condition in multithreaded applications
Source: https://owasp.org/www-community/vulnerabilities/Time_of_check_time_of_use
Topics
Community Discussion
No community discussion yet for this question.