Path argument with /../, /abs/path/,
or other unsecure elements
This defect occurs when you create a relative or absolute path from a tainted source and you then use the path to open/create files.
Relative path elements, such as ".." can
resolve to locations outside the intended folder. Absolute path elements,
such as "/abs/path" can also resolve to locations
outside the intended folder.
An attacker can use these types of path traversal elements to traverse to the rest of the file system and access other files or folders.
Avoid vulnerable path traversal elements such as /../ and /abs/path/.
Use fixed file names and locations wherever possible.
| Group: Security |
| Language: C | C++ |
| Default: Off |
Command-Line Syntax: PATH_TRAVERSAL |
| Impact: Low |
| CWE ID: 22, 23, 36 |
Find defects (-checkers) | Use of path manipulation function without maximum sized buffer checking