This vulnerability occurs when a system copies a file or resource but delays setting its final permissions until the entire copy operation is finished. During the copy process, the resource remains exposed with default or overly permissive access, creating a temporary window where unauthorized users or processes could read, modify, or delete it.
This race condition is a classic time-of-check to time-of-use (TOCTOU) flaw specific to resource duplication. When an application copies a file—for example, during installation, backup, or user upload—it often creates the new file with broad default permissions (like world-readable) to ensure the copy succeeds. The intended restrictive permissions are only applied after the data transfer is complete. This gap, however brief, is a real security risk, especially on multi-user systems or shared hosting environments where other processes are actively running. To prevent this, developers should implement atomic operations where possible, such as creating the file with the correct permissions from the outset before writing data. Alternatively, copy operations can be performed in a secure, isolated temporary location with strict access controls, and the file should only be moved to its final destination after both the data and the correct permissions are fully applied, eliminating the exposure window.
Impact: Read Application DataModify Application Data