From owner-freebsd-bugs@freebsd.org Fri Jan 13 07:13:46 2017 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70B47CACDBF for ; Fri, 13 Jan 2017 07:13:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 483B41042 for ; Fri, 13 Jan 2017 07:13:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D7DkQ7054884 for ; Fri, 13 Jan 2017 07:13:46 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 216014] /etc/shells security vagueness affecting ports Date: Fri, 13 Jan 2017 07:13:46 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: freebsd@phil.spodhuis.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 07:13:46 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D216014 Bug ID: 216014 Summary: /etc/shells security vagueness affecting ports Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: misc Assignee: freebsd-bugs@FreeBSD.org Reporter: freebsd@phil.spodhuis.org The shells(5) manpage describes /etc/shells as "a list of the shells on the system". The top of /usr/src/etc/shells documents the historical meaning: # List of acceptable shells for chpass(1). # Ftpd will not allow users to connect who are not using # one of these shells. My recollection is that 20 years ago, it was considered a security flaw for /etc/shells to list an untrusted shell, as the whole point was to define "i= f a user has one of these shells, then they're trusted for local system access". Indeed, /usr/bin/chpass is setuid-root and uses "ok_shell()" to enforce exa= ctly this behavior; so if arbitrary code can be gotten running as uid N, it can invoke chpass to change shell to any shell listed in /etc/shells, as long as the current shell is listed in that file too. Thus providing a privilege escalation attack. Yet the standard behavior of Ports is to add _all_ shells, including restri= cted shells, to /etc/shells. grep '^@shell' /usr/ports/shells/*/pkg-plist rbash, rzsh, scponly; also devel/git adds libexec/git-core/git-shell too. Users with any of those should _not_ be able to change their shell. The on= ly reason I can think of to add these shells to /etc/shells is some gateway software deciding to only allow access if the shell is listed and so reject= ing restricted shells ... which is a bug. So either the description in /usr/src/etc/shells is wrong and chpass is a security hole, or the man-page shells(5) is wrong and has led to many Ports being configured to introduce security holes when installed. --=20 You are receiving this mail because: You are the assignee for the bug.=