chroot() without chdir("/")Path-related vulnerabilities for file manipulated after
call to chroot
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("/").
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.
After calling chroot, call chdir("/") to
make your chroot jail more secure.
| Group: Security |
| Language: C | C++ |
| Default: Off |
Command-Line Syntax: CHROOT_MISUSE |
| Impact: Medium |
| CWE ID: 243, 922 |
Find defects (-checkers) | Umask used with chmod-style arguments | Vulnerable path manipulation