From owner-freebsd-security-notifications Tue Jul 16 22:00:25 1996 Return-Path: owner-security-notifications Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id WAA25658 for security-notifications-outgoing; Tue, 16 Jul 1996 22:00:25 -0700 (PDT) Received: from precipice.shockwave.com (ppp-5-67.rdcy01.pacbell.net [206.170.5.67]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id WAA25639 for ; Tue, 16 Jul 1996 22:00:21 -0700 (PDT) Received: from shockwave.com (localhost.shockwave.com [127.0.0.1]) by precipice.shockwave.com (8.7.5/8.7.3) with ESMTP id VAA01736 for ; Tue, 16 Jul 1996 21:59:47 -0700 (PDT) Message-Id: <199607170459.VAA01736@precipice.shockwave.com> From: "FreeBSD Security Officer" To: freebsd-security-notifications@freebsd.org Subject: FreeBSD Security Advisory 96:16 - rdist Date: Tue, 16 Jul 1996 21:59:47 -0700 Sender: owner-security-notifications@freebsd.org X-Loop: FreeBSD.org Precedence: bulk -----BEGIN PGP SIGNED MESSAGE----- ============================================================================= FreeBSD-SA-96:16 Security Advisory Revised: Fri Jul 12 09:32:53 PDT 1996 FreeBSD, Inc. Topic: security vulnerability in rdist Category: core Module: rdist Announced: 1996-07-12 Affects: FreeBSD 2.0, 2.0.5, 2.1, 2.1-stable, and 2.2-current Corrected: 2.1-stable and 2.2-current as of 1996-07-11 Source: 4.4BSD (lite) FreeBSD only: no Patches: ftp://freebsd.org/pub/CERT/patches/SA-96:16/ Reference: [8lgm]-Advisory-26.UNIX.rdist.20-3-1996 ============================================================================= I. Background A bug was found in the BSD rdist utility which can allow an unprivileged local user to gain unauthorized access. This problem is present in all source code and binary distributions of FreeBSD version 2.x released before 1996-07-12. rdist has been the subject of security vulnerabilities in the past. This is a newly discovered vulnerability not related to previous race conditions fixed in rdist. II. Problem Description rdist creates an error message based on a user provided string, without checking bounds on the buffer used. This buffer is on the stack, and can therefore be used to execute arbitrary instructions. III. Impact This vulnerability can allow a local user to obtain superuser privileges. It may only be exploited by users with a valid account on the local system. It is present in almost all BSD derived operating systems with a "setuid" rdist program. IV. Workaround The rdist program must be setuid root to function properly. This vulnerability can be eliminated by making rdist not executable by unprivileged users. Since this limits the usefulness of the program, a software update is advised. This workaround will work for all versions of FreeBSD affected by this problem. As root, execute the commands: # chflags noschg /usr/bin/rdist # chmod u-s,go-rx /usr/bin/rdist then verify that the setuid permissions of the files have been removed. The permissions array should read "-r-x------" as shown here: # ls -l /usr/bin/rdist -r-x------ 1 root bin 49152 Jun 16 10:46 rdist V. Solution(s) Apply the available via FTP from the patch directory noted at the top of this message. Recompile, and reinstall the rdist program. This patch is known to apply to all FreeBSD 2.x systems, it has not been tested with FreeBSD 1.x. The [8lgm] organization correctly points out that this program does not have a particularly good security "history." While the patch for this vulnerability does solve this particular problem, it's not clear if other security issues involving rdist will appear in the future. Administrators should consider whether it is appropriate to remove the standard rdist program and upgrade to rdist version 6, which is available as a FreeBSD port. FreeBSD, Inc. has not replaced the standard BSD rdist with the newer code because the new rdist is not protocol-compatible with the original version. ============================================================================= FreeBSD, Inc. Web Site: http://www.freebsd.org/ Confidential contacts: security-officer@freebsd.org PGP Key: ftp://freebsd.org/pub/CERT/public_key.asc Security notifications: security-notifications@freebsd.org Security public discussion: security@freebsd.org Notice: Any patches in this document may not apply cleanly due to modifications caused by digital signature or mailer software. Please reference the URL listed at the top of this document for original copies of all patches if necessary. ============================================================================= -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBMeaC1FUuHi5z0oilAQHtzQP/U1f9y0R+upwCs5IFeBCUBVkFWUeJ/Wwb CJPFmsBr54quI6Aie/LXa/Qw8EdrL54GIiNDZYkAzb9XvWOehOsmtoYN4oj0JAbJ lesq746xOEfNMtpL866T8dxJRTsK98VMSaZK5IU8fVpVYUURcVDv+y+bqfL72Mst 3ajof2ieNxE= =j2z5 -----END PGP SIGNATURE----- From owner-freebsd-security-notifications Tue Jul 16 22:00:54 1996 Return-Path: owner-security-notifications Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id WAA25776 for security-notifications-outgoing; Tue, 16 Jul 1996 22:00:54 -0700 (PDT) Received: from precipice.shockwave.com (ppp-5-67.rdcy01.pacbell.net [206.170.5.67]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id WAA25763 for ; Tue, 16 Jul 1996 22:00:51 -0700 (PDT) Received: from shockwave.com (localhost.shockwave.com [127.0.0.1]) by precipice.shockwave.com (8.7.5/8.7.3) with ESMTP id WAA01758 for ; Tue, 16 Jul 1996 22:00:17 -0700 (PDT) Message-Id: <199607170500.WAA01758@precipice.shockwave.com> From: "FreeBSD Security Officer" To: freebsd-security-notifications@freebsd.org Subject: FreeBSD Security Advisory 96:17 - rzsz Date: Tue, 16 Jul 1996 22:00:16 -0700 Sender: owner-security-notifications@freebsd.org X-Loop: FreeBSD.org Precedence: bulk -----BEGIN PGP SIGNED MESSAGE----- ============================================================================= FreeBSD-SA-96:17 Security Advisory Revised: Tue Jul 16 21:44:54 PDT 1996 FreeBSD, Inc. Topic: "Trojan Horse" vulnerability via rz program Category: ports Module: rzsz Announced: 1996-07-16 Affects: All FreeBSD ports collections released before 2.1.5-RELEASE Corrected: ports collection as of 1996-07-06 Source: rzsz shareware package FreeBSD only: no Patches: ftp://freebsd.org/pub/CERT/patches/SA-96:17/ ============================================================================= I. Background All existing versions of the rz program (a program for receiving files over serial lines using the Z-Modem protocol) are equipped with a feature that allows the sender of a file to request the execution of arbitrary commands on the receiver's side. The user using rz does not have any control over this feature. The workaround is to have rz never execute any command, and always pretend a successful execution. All FreeBSD users are encouraged to use the workaround provided. Since the intent of the Z-Modem protocol is to provide a reliable connection between systems of a vastly different architecture, the execution of local commands at request of the sending side cannot even be considered a useful feature at all. II. Problem Description The Z-Modem protocol specifies a mechanism which allows the transmitter of a file to execute an arbitrary command string as part of the file transfer. This is typically used to rename files or eliminate temporary files. A malicious "trusted" sender could send down a command that could damage a user's environment. III. Impact The rzsz package is an optional port that made be installed on some FreeBSD systems. This program is not installed by default. Systems without this program are not vulnerable. rz allows "Trojan Horse" type attacks against unsuspecting users. Since the rz executable does not run with special privileges, the vulnerability is limited to changes in the operating environment that the user could willingly perform. This vulnerability is a fundamental flaw in the Z-Modem protocol. Other operating systems and other implementations of the Z-Modem protocol may also suffer similar vulnerabilities. IV. Workaround Disable the rz program. If it has been installed, it would typically be found in /usr/local/bin. # chmod 000 /usr/local/bin/rz # ls -l /usr/local/bin/rz ---------- 1 root wheel 23203 Mar 4 23:12 /usr/local/bin/rz V. Solution(s) This feature is a relatively unknown part of the Z-Modem protocol. It is not critical to file transfers in general. The safest approach is to disable this feature in the receiving program. Any rzsz port that is obtained from the official ports collection after 1996-07-06 includes the following patch to disable this feature. This patch applies to rzsz v3.42, if you have an earlier version of the rzsz sources, please upgrade to the latest version first. *** rz.c.orig Sat Jul 6 17:34:26 1996 --- rz.c Sat Jul 6 17:44:52 1996 *************** *** 1020,1039 **** --- 1020,1045 ---- case ZCOMMAND: cmdzack1flg = Rxhdr[ZF0]; if (zrdata(secbuf, 1024) == GOTCRCW) { + #ifdef BIG_SECURITY_HOLE void exec2(); if (cmdzack1flg & ZCACK1) stohdr(0L); else stohdr((long)sys2(secbuf)); + #else + stohdr(0L); + #endif purgeline(); /* dump impatient questions */ do { zshhdr(4,ZCOMPL, Txhdr); } while (++errors<20 && zgethdr(Rxhdr) != ZFIN); ackbibi(); + #ifdef BIG_SECURITY_HOLE if (cmdzack1flg & ZCACK1) exec2(secbuf); + #endif return ZCOMPL; } zshhdr(4,ZNAK, Txhdr); goto again; ============================================================================= FreeBSD, Inc. Web Site: http://www.freebsd.org/ Confidential contacts: security-officer@freebsd.org PGP Key: ftp://freebsd.org/pub/CERT/public_key.asc Security notifications: security-notifications@freebsd.org Security public discussion: security@freebsd.org Notice: Any patches in this document may not apply cleanly due to modifications caused by digital signature or mailer software. Please reference the URL listed at the top of this document for original copies of all patches if necessary. ============================================================================= -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBMexwFlUuHi5z0oilAQFY8wQAmIkv2scipc+ABrQCfHpSWapM+v2J7s8S 7pqt4ZIdkt5jwBatY4NnsScDAIIYO/chP29hn3sNiHohv/4j1DXoXE57fLCeBkrh SbcY20X5YqpuUqScVTEsJBm40GNf7k98GNtgmLwd/NojRgchIdbx4zJSVo/3H1yK oJdvhrzsGpE= =mZ88 -----END PGP SIGNATURE-----