CWE-363: Race Condition Enabling Link Following
The product checks the status of a file or directory before accessing it, which produces a race condition in which the file can be replaced with a link before the access is performed, causing the product to access the wrong file.
Last updated
Overview
CWE-363 (Race Condition Enabling Link Following) is a base-level software weakness catalogued by MITRE in the Common Weakness Enumeration (CWE). It describes a recurring type of mistake that can lead to exploitable security vulnerabilities.
Real-world CVEs
12 recorded CVEs are caused by CWE-363 (Race Condition Enabling Link Following). The highest-severity and most recent are shown first. 7 new CWE-363 CVEs have been recorded so far in 2026 (2 in 2025).
- CVE-2025-62161
youki container escape via "masked path" abuse due to mount race conditions
High · CVSS 7.3 · EPSS 29th2025-11-05 - CVE-2022-21658
Race condition in std::fs::remove_dir_all in rustlang
High · CVSS 7.3 · EPSS 66th2022-01-20 - CVE-2026-112940
filelock ReadWriteLock: SQLite reopens the lock database by name, so a planted symlink or journal file makes the lock user's process overwrite or unlink its own files
High · CVSS 7.1 · EPSS 2th2026-10-20 - CVE-2026-71125
Oracle VM VirtualBox: Core - denial of service and unauthorized data modification
Medium · CVSS 6.1 · EPSS 1th2026-08-18 - CVE-2026-91203
Cockpit-files: cockpit-files: arbitrary file ownership and permission modification via symlink race condition
Medium · CVSS 6.0 · EPSS 0th2026-09-18 - CVE-2026-91205
Cockpit-files: cockpit-files: local attacker can hijack file ownership via symlink race
Medium · CVSS 6.0 · EPSS 1th2026-09-18 - CVE-2026-112938
filelock: StrictSoftFileLock follows a symbolic link swapped in at .filelock and creates claim files in a directory another local user chooses
Medium · CVSS 5.8 · EPSS 0th2026-11-05 - CVE-2025-13492
HP Image Assistant - Potential Escalation of Privilege
Medium · CVSS 5.4 · EPSS 1th2025-12-03 - CVE-2026-112914
filelock: SoftFileLock stale-break restore follows a swapped-in symbolic link and hard-links a file of the user running the lock into the lock directory
Medium · CVSS 5.3 · EPSS 1th2026-10-20 - CVE-2018-6693
Endpoint Security for Linux Threat Prevention (ENSLTP) privilege escalation vulnerability
Medium · CVSS 5.3 · EPSS 5th2018-09-18 - CVE-2024-45310
runc can be confused to create empty files/directories on the host
Medium · CVSS 4.8 · EPSS 16th2024-09-03 - CVE-2026-27139
FileInfo can escape from a Root in os
Low · CVSS 2.5 · EPSS 1th2026-03-06
Common consequences
What can happen when CWE-363 is exploited.
Read Files or Directories, Modify Files or Directories
Affects: Confidentiality, Integrity
An attacker could cause the product to slow down (e.g. with memory consumption), causing the time window to become larger. Alternately, in some situations, the attacker could win the race by performing a large number of attacks.
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
How to detect it
Automated Static Analysis
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Code examples
MITRE examples of the weakness in code.
This code prints the contents of a file if a user has permission.
Vulnerable example
function readFile($filename){
$user = getCurrentUser();
//resolve file if its a symbolic link
if(is_link($filename)){
$filename = readlink($filename);
}
if(fileowner($filename) == $user){
echo file_get_contents($realFile);
return;
}
else{
echo 'Access denied';
return false;
}
}This code attempts to resolve symbolic links before checking the file and printing its contents. However, an attacker may be able to change the file from a real file to a symbolic link between the calls to is_link() and file_get_contents(), allowing the reading of arbitrary files. Note that this code fails to log the attempted access (CWE-778).
Terminology & mappings
Mapped taxonomies
- PLOVER: Race condition enabling link following
- CERT C Secure Coding: Avoid race conditions while checking for the existence of a symbolic link (POS35-C) — Exact fit
- Software Fault Patterns: Race Condition Window (SFP20)
Attack patterns
CAPEC attack patterns that exploit this weakness.
Frequently asked questions
Common questions about CWE-363.
- What is CWE-363?
- The product checks the status of a file or directory before accessing it, which produces a race condition in which the file can be replaced with a link before the access is performed, causing the product to access the wrong file.
- What CVEs are caused by CWE-363?
- 12 recorded CVEs are attributed to CWE-363, including CVE-2025-62161, CVE-2022-21658 and CVE-2026-112940.
- How is CWE-363 detected?
- Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
- What are the consequences of CWE-363?
- Exploiting CWE-363 can lead to: Read Files or Directories, Modify Files or Directories.
- Is CWE-363 actively exploited?
- 12 recorded CVEs are caused by CWE-363; none are currently in CISA's KEV catalog of actively exploited flaws.
Sources
- [1]The Art of Software Security Assessment (2006)
References
- MITRE CWE definition (CWE-363) (opens in a new tab)
- CWE-363 vulnerabilities on NVD (opens in a new tab)
- Learn: What is a CWE?
Weakness data is sourced from the MITRE CWE catalog (v4.21). CVE associations are aggregated and kept current by RadicalNotion.AI.
Track CWE-363 CVEs
Get an alert when a new CWE-363 CVE affects your products, with AI-written analysis and remediation steps.