Vulnerable path manipulation
Path argument with /../
, /abs/path/
,
or other unsecure elements
Description
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.
Risk
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.
Fix
Avoid vulnerable path traversal elements such as /../
and /abs/path/
.
Use fixed file names and locations wherever possible.
Examples
Result Information
Group: Security |
Language: C | C++ |
Default: Off |
Command-Line Syntax: PATH_TRAVERSAL |
Impact: Low |
Version History
Introduced in R2015b
See Also
Use of path manipulation function without maximum-sized buffer checking
| Find defects (-checkers)
Topics
- Interpret Bug Finder Results in Polyspace Desktop User Interface
- Interpret Bug Finder Results in Polyspace Access Web Interface (Polyspace Access)
- Address Results in Polyspace User Interface Through Bug Fixes or Justifications
- Address Results in Polyspace Access Through Bug Fixes or Justifications (Polyspace Access)