CAPEC-76: Manipulating Web Input to File System Calls
Description
An attacker manipulates inputs to the target software which the target software passes to file system calls in the OS. The goal is to gain access to, and perhaps modify, areas of the file system that the target software did not intend to be accessible.
- Likelihood of attack
- High
- Typical severity
- Very High
- Abstraction
- DetailedA low-level, detailed pattern, often for a particular technology.
Mechanism of attack: Manipulate Data Structures
Prerequisites
- Program must allow for user controlled variables to be applied directly to the filesystem
Skills required
- LowTo identify file system entry point and execute against an over-privileged system interface
Consequences
- ConfidentialityAccess ControlAuthorization
Gain Privileges
- Integrity
Modify Data
Mitigations
- Design: Enforce principle of least privilege.
- Design: Ensure all input is validated, and does not contain file system commands
- Design: Run server interfaces with a non-root account and/or utilize chroot jails or other configuration techniques to constrain privileges even if attacker gains some limited access to commands.
- Design: For interactive user applications, consider if direct file system interface is necessary, instead consider having the application proxy communication.
- Implementation: Perform testing such as pen-testing and vulnerability scanning to identify directories, programs, and interfaces that grant direct access to executables.
Related weaknesses (CWE)
- CWE-15External Control of System or Configuration Setting
- CWE-22Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
- CWE-23Relative Path Traversal
- CWE-59Improper Link Resolution Before File Access ('Link Following')
- CWE-73External Control of File Name or Path
- CWE-74Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
- CWE-77Improper Neutralization of Special Elements used in a Command ('Command Injection')
- CWE-272Least Privilege Violation
- CWE-285Improper Authorization
- CWE-346Origin Validation Error
- CWE-348Use of Less Trusted Source