Insecure Operation on Windows Junction / Mount Point

Incomplete Base
Structure: Simple
Description

This vulnerability occurs when a Windows application opens a file or directory without properly validating that the path is not a symbolic link (junction or mount point) pointing to a location outside the application's intended security boundary.

Extended Description

On Windows NTFS file systems, junction points and mount points are types of symbolic links (reparse points) that can redirect file operations from one directory to another, potentially to a completely different drive or privileged location. If an application with elevated privileges opens a file without checking for these links, an attacker can replace the expected file with a link to a sensitive system file, registry key, or named object, tricking the application into performing unauthorized read, write, or delete operations. This allows privilege escalation or data manipulation because the privileged process unknowingly operates on the attacker's target. For example, an attacker could redirect a file operation to AUTOEXEC.BAT, critical configuration files, or security databases, causing the application to corrupt, expose, or modify sensitive data with its own high-level permissions. Developers must explicitly validate paths and handle reparse points to confine operations within the intended directory scope.

Common Consequences 3
Scope: Confidentiality

Impact: Read Files or Directories

Read arbitrary files by replacing a user-controlled folder with a mount point and additional hard links.

Scope: Integrity

Impact: Modify Files or Directories

Modify an arbitrary file by replacing the rollback files in installer directories, as they can have the installer execute those rollbacks.

Scope: Availability

Impact: Modify Files or Directories

Even if there is no control of contents, an arbitrary file delete or overwrite (when running as SYSTEM or admin) can be used for a permanent system denial-of-service, e.g. by deleting a startup configuration file that prevents the service from starting.

Potential Mitigations 1
Phase: Architecture and Design

Strategy: Separation of Privilege

When designing software that will have different rights than the executer, the software should check that files that it is interacting with are not improper hard links or mount points. One way to do this in Windows is to use the functionality embedded in the following command: "dir /al /s /b" or, in PowerShell, use LinkType as a filter. In addition, some software uses authentication via signing to ensure that the file is the correct one to use. Make checks atomic with the file action, otherwise a TOCTOU weakness (Time-of-check Time-of-use (TOCTOU) Race Condition) can be introduced.
Observed Examples 4
CVE-2021-26426Privileged service allows attackers to delete unauthorized files using a directory junction, leading to arbitrary code execution as SYSTEM.
CVE-2020-0863By creating a mount point and hard links, an attacker can abuse a service to allow users arbitrary file read permissions.
CVE-2019-1161Chain: race condition (Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')) in anti-malware product allows deletion of files by creating a junction (Insecure Operation on Windows Junction / Mount Point) and using hard links during the time window in which a temporary file is created and deleted.
CVE-2014-0568Escape from sandbox for document reader by using a mountpoint [REF-1264]
References 6
Follow the Link: Exploiting Symbolic Links with Ease
Eran Shimony
03-10-2019
ID: REF-1262
Windows 10^H^H Symbolic Link Mitigations
James Forshaw
25-08-2015
ID: REF-1264
Understanding and Exploiting Symbolic links in Windows - Symlink Attack EOP
Shubham Dubey
16-04-2020
ID: REF-1266
Abusing Arbitrary File Deletes to Escalate Privilege and Other Great Tricks
Simon Zuckerbraun
17-03-2022
ID: REF-1267
Abusing privileged file operations
Clément Lavoillotte
20-03-2019
ID: REF-1271
Applicable Platforms
Languages:
Not Language-Specific : Undetermined
Modes of Introduction
Implementation
Notes
TerminologySymbolic links, hard links, junctions, and mount points can be confusing terminology, as there are differences in how they operate between UNIX-based systems and Windows, and there are interactions between them.
MaintenanceThis entry is still under development and will continue to see updates and content improvements.