From owner-freebsd-security@freebsd.org Thu Sep 1 13:44:00 2016 Return-Path: Delivered-To: freebsd-security@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 7B082BCB0BF for ; Thu, 1 Sep 2016 13:44:00 +0000 (UTC) (envelope-from me@myconan.net) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (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 53C785F5 for ; Thu, 1 Sep 2016 13:44:00 +0000 (UTC) (envelope-from me@myconan.net) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id F026A2045B for ; Thu, 1 Sep 2016 09:43:58 -0400 (EDT) Received: from web3 ([10.202.2.213]) by compute6.internal (MEProxy); Thu, 01 Sep 2016 09:43:58 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=myconan.net; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=YMTcGquotl13zaOcHDHWaXWXRU0=; b=rDi/pO VBUlgaJMZYcu9D2c9j+iOqqj9tRv7PODnPusGs8oWxHvznEAyyVKjKUtIHlDOoph MUmCt1JhUXVWsxpTqsq1sHyxaMv+UY3teDEq3DboXrLwGawp5soMARquL7yGmygZ or7SWMqxPsVLt8g4KATt/EZVYa4Y4R2bwFR/U= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=YMTcGquotl13zaO cHDHWaXWXRU0=; b=MpAIhe9Zxm2tfGkcrdMwPIKryw6b6kSfIAvbmun46IybwSP 15YYkCZ0BFo4M4AQ0Hbb8JbrTGCza627C83cYGNROo9uAoMls4j/KiojmEv3wT6v 3RaeSnhZbLM7b80SA8sk+/wllRYI2+/MlXZUpvQIhA4MttDko+pFvvs6frco= Received: by mailuser.nyi.internal (Postfix, from userid 99) id BAB2E168FF; Thu, 1 Sep 2016 09:43:58 -0400 (EDT) Message-Id: <1472737438.3589865.712736753.5CFBB0DC@webmail.messagingengine.com> X-Sasl-Enc: h+FeFkcouOr6Ifj6FK8PEHXVNBdbfEMFDfndjZ+7jbj+ 1472737438 From: Edho Arief To: freebsd-security@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-8baf8b60 Subject: Re: edit others user crontab, security bug Date: Thu, 01 Sep 2016 22:43:58 +0900 In-Reply-To: References: X-BeenThere: freebsd-security@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Security issues \[members-only posting\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2016 13:44:00 -0000 Hi, On Thu, Sep 1, 2016, at 21:47, Andrii Kuzik wrote: > Probably a lot of freebsd servers affected > > Security bug allows to edit other users crontab > > root# pw useradd -n www.promspecbud.com -g nobody -s /bin/sh -d /tmp > root# pw useradd -n www.promspecbud.com.other -g nobody -s /bin/sh -d > /tmp > root# echo @daily doit baby > /tmp/test > root# crontab -u www.promspecbud.com.other /tmp/test > root# crontab -u www.promspecbud.com -l > > =====output ===== > @daily doit baby > ================= > > root#echo @daily doit baby one more time>> /tmp/test > root#sudo -u www.promspecbud.com.other crontab /tmp/test > root#sudo -u www.promspecbud.com crontab -l > =====output ===== > @daily doit baby > @daily doit baby one more time > ================= > to be more specific, the bug is crontab truncates usernames to 19 characters as defined in cron.h: #define MAX_UNAME 20 /* max length of username, should be overkill */ # pw useradd users12345names67890 # crontab -u users12345names67890 -l crontab: no crontab for users12345names6789 ^-- cut off