nerdexam
CompTIA

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.

Technical Integration of Enterprise Security

Question

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 data model file does not exist 1.2 extract yesterday's data model 1.3 transform the format 1.4 load the transformed data into today's data model file 1.5 exit Which of the following security concerns is evident in the above pseudocode?

Options

  • ATime of check/time of use
  • BResource exhaustion
  • CImproper storage of sensitive data
  • DPrivilege escalation

How the community answered

(32 responses)
  • A
    56% (18)
  • B
    6% (2)
  • C
    22% (7)
  • D
    16% (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.

ATime of check/time of useCorrect

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.

BResource exhaustion

Resource exhaustion involves depleting system resources such as memory or CPU cycles, which is not demonstrated anywhere in this sequential file-based ETL workflow.

CImproper storage of sensitive data

Improper storage of sensitive data would involve writing data to insecure or unencrypted locations, a concern the pseudocode does not illustrate.

DPrivilege escalation

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

#TOCTOU#race condition#secure coding#multithreading

Community Discussion

No community discussion yet for this question.

Full CAS-003 Practice