From owner-freebsd-ports-bugs@FreeBSD.ORG Fri May 6 20:50:13 2011 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA39A1065680 for ; Fri, 6 May 2011 20:50:13 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id AC4248FC14 for ; Fri, 6 May 2011 20:50:13 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p46KoDki088242 for ; Fri, 6 May 2011 20:50:13 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p46KoDIh088241; Fri, 6 May 2011 20:50:13 GMT (envelope-from gnats) Resent-Date: Fri, 6 May 2011 20:50:13 GMT Resent-Message-Id: <201105062050.p46KoDIh088241@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Chris Rees Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF3F2106566C for ; Fri, 6 May 2011 20:44:37 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id BDDE78FC15 for ; Fri, 6 May 2011 20:44:37 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p46KibIY031659 for ; Fri, 6 May 2011 20:44:37 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p46KibYL031658; Fri, 6 May 2011 20:44:37 GMT (envelope-from nobody) Message-Id: <201105062044.p46KibYL031658@red.freebsd.org> Date: Fri, 6 May 2011 20:44:37 GMT From: Chris Rees To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/156853: Update docs: jail(8) security issues with world-readable jail root X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2011 20:50:14 -0000 >Number: 156853 >Category: ports >Synopsis: Update docs: jail(8) security issues with world-readable jail root >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Fri May 06 20:50:13 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Chris Rees >Release: >Organization: >Environment: >Description: I brought this problem up on freebsd-security two years ago [1], and promptly forgot about it, but then another person [2] has brought it up again... Jails have a problem in that if the jail directory is world-readable, an attacker with root access to the jail can create a setuid binary for their own use in the host environment (if they also have this access), thus breaking root in the host. [1] http://freebsd.1045724.n5.nabble.com/Thoughts-on-jail-privilege-FAQ-submission-td4219099.html [2] http://lists.freebsd.org/pipermail/freebsd-security/2011-May/005886.html >How-To-Repeat: Follow instructions in the Handbook or jail(8) manpage, create a setuid binary inside the jail as root, and run it as unprivileged user in the host. >Fix: No fix, but precautions can be taken; this exploit is impossible if the jail's files are not world-readable. Docs patches for the Handbook [3] and for the jail(8) manpage [4] are provided. - Advise 0700 permissions for jail root directory to stop various exploits Patch submitted by: Chris Rees (utisoft@gmail.com) Discovered by: Chris Rees (utisoft@gmail.com) and Pétur Ingi Egilsson (petur@petur.eu) [3] http://www.bayofrum.net/~crees/patches/jail-secure-handbook.diff [4] http://www.bayofrum.net/~crees/patches/jail-secure-manpage.diff >Release-Note: >Audit-Trail: >Unformatted: