The handbook chapter on jails contains this warning:
I tracked the source of the warning down to these discussions:
It would appear that you can patch the suid security hole by ensuring the directory hosting the jail roots is
I haven't been able to identify any other obvious gotchas which could let a superuser in a jail and a regular user on the host conspire to achieve root on the host. Can you think of any? Are they likely to exist?
I'm trying to understand how much of a risk it is having a regular user on the host of a machine running jails.
Important: Jails are a powerful tool, but they are not a security panacea. It is particularly important to note that while it is not possible for a jailed process to break out on its own, there are several ways in which an unprivileged user outside the jail can cooperate with a privileged user inside the jail and thereby obtain elevated privileges in the host environment.
Most of these attacks can be mitigated by ensuring that the jail root is not accessible to unprivileged users in the host environment. Regardless, as a general rule, untrusted users with privileged access to a jail should not be given access to the host environment.
I tracked the source of the warning down to these discussions:
- http://lists.freebsd.org/pipermail/freebsd-security/2011-May/005886.html
- http://lists.freebsd.org/pipermail/freebsd-security/2009-January/005097.html
It would appear that you can patch the suid security hole by ensuring the directory hosting the jail roots is
chmod 700
, because then regular users on the host cannot see into or execute any binaries in the jail which are suid.I haven't been able to identify any other obvious gotchas which could let a superuser in a jail and a regular user on the host conspire to achieve root on the host. Can you think of any? Are they likely to exist?
I'm trying to understand how much of a risk it is having a regular user on the host of a machine running jails.