Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Mar 2014 08:09:01 -0500 (EST)
From:      Randy Schultz <schulra@earlham.edu>
To:        Nicola Galante <galante@veritas.sao.arizona.edu>
Cc:        freebsd-bugs@FreeBSD.org, freebsd-gnats-submit@FreeBSD.org
Subject:   Re: misc/187307: Security vulnerability with FreeBSD Jail
Message-ID:  <alpine.BSF.2.00.1403060808010.43220@localhost>
In-Reply-To: <201403052307.s25N7NoD045308@cgiserv.freebsd.org>
References:  <201403052307.s25N7NoD045308@cgiserv.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 5 Mar 2014, Nicola Galante wrote:

-}
-}I found a potential vulnerability with FreeBSD jails. I installed a server (hostserver) for my institute. This hostserver has a certain IP address, let's say 10.0.0.100, and I installed and configured three service jails (elog, mail, www), each with a different IP address (10.0.0.101, 10.0.0.102, 10.0.0.103)
-}
-}  root@hostserver:/jails/j # jls
-}   JID  IP Address      Hostname                      Path
-}     1  10.0.0.101      elogjail                  /jails/j/elog
-}     2  10.0.0.102      mailjail                  /jails/j/mail
-}     3  10.0.0.103      wwwjail                   /jails/j/www
-}
-}I have an account on both the hostserver and the elogjail. Password authentication on hostserver and ssh key authentication in the jail. The service sshd is running on both the hostserver and elogjail. If I ssh into the elogjail
-}
-}  [galante@caronte ~]$ ssh galante@elogjail
-}  Enter passphrase for key '/home/galante/.ssh/id_dsa':
-}  Last login: Wed Mar  5 21:37:23 2014 from caronte
-}  galante@elogjail:~ %
-}
-}as expected. But if I turn off the sshd service in elogjail (and keep the elogjail up and running) and I try to connect to elogjail, I first get a complaint that the fingerprint for the RSA key sent by the remote host has changed. If I remove the corresponding line in my local .ssh/known_hosts file and try to reconnect, this is what happens:
-}
-}  [galante@caronte ~]$ ssh galante@elogjail
-}  Password for galante@hostserver:
-}  Last login: Wed Mar  5 21:12:20 2014 from caronte
-}  galante@hostserver:~ %
-}
-}I log into the host system! Of course this is possible because I have an account on both the host system and the jail. However, I believe that this can cause a serious potential security threat. I can envision several scenarios where somebody attempts to get into a jail and instead gets into the host system. I checked also the DNS responsiveness. The problem persists even if I use IP addresses instead of host names.
-}>How-To-Repeat:
-}Follow the steps described above. 
-}>Fix:
-}I don't know how to fix the problem other than by disabling sshd in the hostserver.

Set ssdh on hostserver to only listen on 10.0.0.100 should prevent this from
happening.  By default sshd listens on all addresses.

--
 Randy    (schulra@earlham.edu)      765.983.1283         <*>

Hatred does not cease by hatred, but only by love; this is the eternal rule.
     - Siddhartha Gautama




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1403060808010.43220>