__________________________________________________________ The U.S. Department of Energy Computer Incident Advisory Capability ___ __ __ _ ___ / | /_\ / \___ __|__ / \ \___ __________________________________________________________ INFORMATION BULLETIN 'rsync' Unsanitised Input Processing [Rsync 2.6.3pre1 released] August 17, 2004 18:00 GMT Number O-198 [REVISED 03 Sep 2004] ______________________________________________________________________________ PROBLEM: There is a security related problem in rsync with unsanitized input processing. PLATFORM: Those running rsync 2.6.2 or earlier, and those running vendor-specific rsync codes based on rsync 2.6.2 or earlier, including, but not limited to the following: Debian GNU/Linux 3.0 (woody) Red Hat Enterprise Linux AS, ES, and WS v.3 Red Hat Enterprise Linux AS, ES, and WS v.2.1 DAMAGE: A remote attacker could read and write files outside of the defined directory. SOLUTION: Upgrade the rsync package where possible. Rsync has published a patch for rsync 2.6.2, and offers a pre-release version of rsync 2.6.3 which has the bug fix. ______________________________________________________________________________ VULNERABILITY The risk is MEDIUM. The rsync daemon is often run as root and ASSESSMENT: a remote user can take advantage of the vulnerability to read and write files with root privileges. ______________________________________________________________________________ LINKS: CIAC BULLETIN: http://www.ciac.org/ciac/bulletins/o-198.shtml ORIGINAL BULLETIN: http://rsync.samba.org/ ADDITIONAL LINKS: Debian Security Advisory DSA-538 http://www.debian.org/security/2004/dsa-538 Red Hat: RHSA-2004:436-07 https://rhn.redhat.com/errata/RHSA-2004-436.html ______________________________________________________________________________ REVISION HISTORY: 09/03/2004 - added link to Red Hat's advisory. [***** Start of extraction from http://rsync.samba.org/ *****] Rsync 2.6.3pre1 released August 12th, 2004 Rsync version 2.6.3pre1 has been released. It contains a few new features and quite a few bug fixes. Please help out with the testing so that we give the latest code a good workout. See the NEWS file for the details of what changed since 2.6.2. See the download page for all the ways to grab the new version (previews are in the "preview" subdir), or snag one of these: rsync-2.6.3pre1.tar.gz (signature), rsync-2.6.1-2.6.3pre1.diffs.gz (signature). August 2004 Security Advisory August 12th, 2004 Background There is a path-sanitizing bug that affects daemon mode in all recent rsync versions (including 2.6.2) but only if chroot is disabled. It does NOT affect the normal send/receive filenames that specify what files should be transferred (this is because these names happen to get sanitized twice, and thus the second call removes any lingering leading slash(es) that the first call left behind). It does affect certain option paths that cause auxilliary files to be read or written. The Fix The best fix is to apply this one-word patch to the sanitize_path() function in util.c: --- orig/util.c 2004-04-27 12:59:37 -0700 +++ util.c 2004-08-11 23:37:27 -0700 @@ -743,7 +743,7 @@ allowdotdot = 1; } else { p += 2; - if (*p == '/') + while (*p == '/') p++; if (sanp != start) { /* back up sanp one level */ This bug is fixed in the CVS version of rsync, and will be released in version 2.6.3 (it is currently in release-testing). One potential fix that doesn't require recompiling rsync is to set "use chroot = true" for all the modules in the rsyncd.conf file. [***** End of extraction from http://rsync.samba.org/ *****] _______________________________________________________________________________ CIAC wishes to acknowledge the contributions of Debian for the information contained in this bulletin. _______________________________________________________________________________ CIAC, the Computer Incident Advisory Capability, is the computer security incident response team for the U.S. Department of Energy (DOE) and the emergency backup response team for the National Institutes of Health (NIH). CIAC is located at the Lawrence Livermore National Laboratory in Livermore, California. CIAC is also a founding member of FIRST, the Forum of Incident Response and Security Teams, a global organization established to foster cooperation and coordination among computer security teams worldwide. CIAC services are available to DOE, DOE contractors, and the NIH. CIAC can be contacted at: Voice: +1 925-422-8193 (7x24) FAX: +1 925-423-8002 STU-III: +1 925-423-2604 E-mail: ciac@ciac.org Previous CIAC notices, anti-virus software, and other information are available from the CIAC Computer Security Archive. World Wide Web: http://www.ciac.org/ Anonymous FTP: ftp.ciac.org PLEASE NOTE: Many users outside of the DOE, ESnet, and NIH computing communities receive CIAC bulletins. If you are not part of these communities, please contact your agency's response team to report incidents. Your agency's team will coordinate with CIAC. The Forum of Incident Response and Security Teams (FIRST) is a world-wide organization. A list of FIRST member organizations and their constituencies can be obtained via WWW at http://www.first.org/. This document was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor the University of California nor any of their employees, makes any warranty, express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately owned rights. Reference herein to any specific commercial products, process, or service by trade name, trademark, manufacturer, or otherwise, does not necessarily constitute or imply its endorsement, recommendation or favoring by the United States Government or the University of California. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or the University of California, and shall not be used for advertising or product endorsement purposes. LAST 10 CIAC BULLETINS ISSUED (Previous bulletins available from CIAC) O-188: libapache-mod-ssl O-189: HP-UX xfs and stmkfont Vulnerabilities O-190: Check Point ASN.1 VPN-1 Buffer Overrun O-191: Microsoft Cumulative Security Update for Internet Explorer (867801) O-192: Red Hat Advisory: RHSA-2004:402-08 O-193: Linux Kernel Packages Updated O-194: GNOME VFS "extfs" Vulnerability O-195: Mozilla Updated Security Packages O-196: "glibc" Buffer Overflow Vulnerabilities O-197: Microsoft Exchange Server 5.5 Outlook Web Access Vulnerability