misc/142341: Jail escape when cwd is moved from the host system
vedad at kajtaz.net
Tue Jan 5 09:40:02 UTC 2010
>Synopsis: Jail escape when cwd is moved from the host system
>Arrival-Date: Tue Jan 05 09:40:02 UTC 2010
>Originator: Vedad KAJTAZ
FreeBSD kenny.osilex.net 7.2-RELEASE-p4 FreeBSD 7.2-RELEASE-p4 #0: Fri Oct 2 12:21:39 UTC 2009 root at i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386
Given the following setup:
- A host system
- A jail system located in /usr/local/jails/J1 on the host system
- A shell open in the jail system, with cwd set to /some/path (therefore, /usr/local/jails/J1/some/path on the host system).
When the root moves the /usr/local/jails/J1/some/path folder somewhere else (say in /usr/local/jails/J2/some/path), the jail shell (as any other jail process) in no longer rooted and has access to the whole filesystem on the host.
Though this is not a common situation, it may happen (and did happen to me).
More information about the freebsd-bugs