This vulnerability occurs when an application uses unvalidated user input to construct file or directory paths for filesystem operations.
Path manipulation vulnerabilities arise when an attacker can control the path used in operations like reading, writing, or deleting files. By crafting special inputs containing sequences like '../' (directory traversal), they can force the application to access files or directories outside the intended, restricted location. This can lead to unauthorized access to sensitive system files, application source code, or configuration data. For a successful attack, two conditions must be met: the attacker must be able to specify the path used in a filesystem operation, and doing so must grant them a capability they shouldn't have, such as overwriting a critical file, reading private data, or forcing the application to use a malicious configuration file. The core defense is to never trust user input for path construction; instead, use allowlists, canonicalize paths, and then validate them against a strict list of permitted directories.
Impact: Read Files or DirectoriesModify Files or Directories
The application can operate on unexpected files. Confidentiality is violated when the targeted filename is not directly readable by the attacker.
Impact: Modify Files or DirectoriesExecute Unauthorized Code or Commands
The application can operate on unexpected files. This may violate integrity if the filename is written to, or if the filename is for a program or other form of executable code.
Impact: DoS: Crash, Exit, or RestartDoS: Resource Consumption (Other)
The application can operate on unexpected files. Availability can be violated if the attacker specifies an unexpected file that the application modifies. Availability can also be affected if the attacker specifies a filename for a large file, or points to a special device or a file that does not have the format that the application expects.
Strategy: Input Validation
Effectiveness: High
javajavaHigh