From owner-freebsd-bugs@FreeBSD.ORG Wed Mar 5 23:10:00 2014 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7F1FD7 for ; Wed, 5 Mar 2014 23:10:00 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B4608B01 for ; Wed, 5 Mar 2014 23:10:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s25NA0Jp090235 for ; Wed, 5 Mar 2014 23:10:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s25NA04o090234; Wed, 5 Mar 2014 23:10:00 GMT (envelope-from gnats) Resent-Date: Wed, 5 Mar 2014 23:10:00 GMT Resent-Message-Id: <201403052310.s25NA04o090234@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Nicola Galante Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AECBB7E for ; Wed, 5 Mar 2014 23:07:23 +0000 (UTC) Received: from cgiserv.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 80C82AF3 for ; Wed, 5 Mar 2014 23:07:23 +0000 (UTC) Received: from cgiserv.freebsd.org ([127.0.1.6]) by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s25N7NML045309 for ; Wed, 5 Mar 2014 23:07:23 GMT (envelope-from nobody@cgiserv.freebsd.org) Received: (from nobody@localhost) by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s25N7NoD045308; Wed, 5 Mar 2014 23:07:23 GMT (envelope-from nobody) Message-Id: <201403052307.s25N7NoD045308@cgiserv.freebsd.org> Date: Wed, 5 Mar 2014 23:07:23 GMT From: Nicola Galante To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: misc/187307: Security vulnerability with FreeBSD Jail X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 23:10:01 -0000 >Number: 187307 >Category: misc >Synopsis: Security vulnerability with FreeBSD Jail >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Mar 05 23:10:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Nicola Galante >Release: 10.0 >Organization: Smithsonian Astrophysical Observatory >Environment: FreeBSD hostserver.localdomain 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014 root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 >Description: 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. >Release-Note: >Audit-Trail: >Unformatted: