File manipulation after chroot()
without chdir("/")
Path-related vulnerabilities for file manipulated after
call to chroot
Description
This defect occurs when you have access to a file system outside of the jail created by
chroot
. By calling chroot
, you create a file
system jail that confines access to a specific file subsystem. However, this jail is
ineffective if you do not call chdir("/")
.
Risk
If you do not call chdir("/")
after creating
a chroot
jail, file manipulation functions that
takes a path as an argument can access files outside of the jail.
An attacker can still manipulate files outside the subsystem that
you specified, making the chroot jail ineffective.
Fix
After calling chroot
, call chdir("/")
to
make your chroot
jail more secure.
Examples
Result Information
Group: Security |
Language: C | C++ |
Default: Off |
Command-Line Syntax: CHROOT_MISUSE |
Impact: Medium |
Version History
Introduced in R2015b
See Also
Umask used with chmod-style arguments
| Vulnerable path manipulation
| 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)