diff -Nru rsync-3.1.1/debian/changelog rsync-3.1.1/debian/changelog --- rsync-3.1.1/debian/changelog 2016-01-19 20:01:09.000000000 +0000 +++ rsync-3.1.1/debian/changelog 2017-12-06 14:08:30.000000000 +0000 @@ -1,3 +1,19 @@ +rsync (3.1.1-3ubuntu1.1) xenial-security; urgency=medium + + * SECURITY UPDATE: bypass intended access restrictions + - debian/patches/CVE-2017-17433.patch: check fname in + recv_files sooner in receiver.c. + - CVE-2017-17433 + * SECURITY UPDATE: not check for fnamecmp filenames and + does not apply sanitize_paths + - debian/patches/CVE-2017-17434-part1.patch: check daemon + filter against fnamecmp in receiver.c. + - debian/patches/CVE-2017-17434-part2.patch: sanitize xname + in rsync.c. + - CVE-2017-17434 + + -- Leonidas S. Barbosa Wed, 06 Dec 2017 11:07:22 -0300 + rsync (3.1.1-3ubuntu1) xenial; urgency=medium * SECURITY UPDATE: incomplete fix for rsync path spoofing attack diff -Nru rsync-3.1.1/debian/patches/CVE-2017-17433.patch rsync-3.1.1/debian/patches/CVE-2017-17433.patch --- rsync-3.1.1/debian/patches/CVE-2017-17433.patch 1970-01-01 00:00:00.000000000 +0000 +++ rsync-3.1.1/debian/patches/CVE-2017-17433.patch 2017-12-06 14:05:44.000000000 +0000 @@ -0,0 +1,39 @@ +From 3e06d40029cfdce9d0f73d87cfd4edaf54be9c51 Mon Sep 17 00:00:00 2001 +From: Jeriko One +Date: Thu, 2 Nov 2017 23:44:19 -0700 +Subject: [PATCH] Check fname in recv_files sooner. + +--- + receiver.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +Index: rsync-3.1.1/receiver.c +=================================================================== +--- rsync-3.1.1.orig/receiver.c ++++ rsync-3.1.1/receiver.c +@@ -580,6 +580,12 @@ int recv_files(int f_in, int f_out, char + file = dir_flist->files[cur_flist->parent_ndx]; + fname = local_name ? local_name : f_name(file, fbuf); + ++ if (daemon_filter_list.head ++ && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) { ++ rprintf(FERROR, "attempt to hack rsync failed.\n"); ++ exit_cleanup(RERR_PROTOCOL); ++ } ++ + if (DEBUG_GTE(RECV, 1)) + rprintf(FINFO, "recv_files(%s)\n", fname); + +@@ -651,12 +657,6 @@ int recv_files(int f_in, int f_out, char + + cleanup_got_literal = 0; + +- if (daemon_filter_list.head +- && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) { +- rprintf(FERROR, "attempt to hack rsync failed.\n"); +- exit_cleanup(RERR_PROTOCOL); +- } +- + if (read_batch) { + int wanted = redoing + ? we_want_redo(ndx) diff -Nru rsync-3.1.1/debian/patches/CVE-2017-17434-part1.patch rsync-3.1.1/debian/patches/CVE-2017-17434-part1.patch --- rsync-3.1.1/debian/patches/CVE-2017-17434-part1.patch 1970-01-01 00:00:00.000000000 +0000 +++ rsync-3.1.1/debian/patches/CVE-2017-17434-part1.patch 2017-12-06 14:06:03.000000000 +0000 @@ -0,0 +1,22 @@ +From 5509597decdbd7b91994210f700329d8a35e70a1 Mon Sep 17 00:00:00 2001 +From: Jeriko One +Date: Thu, 16 Nov 2017 17:26:03 -0800 +Subject: [PATCH] Check daemon filter against fnamecmp in recv_files(). + +--- + receiver.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: rsync-3.1.1/receiver.c +=================================================================== +--- rsync-3.1.1.orig/receiver.c ++++ rsync-3.1.1/receiver.c +@@ -729,7 +729,7 @@ int recv_files(int f_in, int f_out, char + break; + } + if (!fnamecmp || (daemon_filter_list.head +- && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0)) { ++ && check_filter(&daemon_filter_list, FLOG, fnamecmp, 0) < 0)) { + fnamecmp = fname; + fnamecmp_type = FNAMECMP_FNAME; + } diff -Nru rsync-3.1.1/debian/patches/CVE-2017-17434-part2.patch rsync-3.1.1/debian/patches/CVE-2017-17434-part2.patch --- rsync-3.1.1/debian/patches/CVE-2017-17434-part2.patch 1970-01-01 00:00:00.000000000 +0000 +++ rsync-3.1.1/debian/patches/CVE-2017-17434-part2.patch 2017-12-06 14:06:14.000000000 +0000 @@ -0,0 +1,36 @@ +From 70aeb5fddd1b2f8e143276f8d5a085db16c593b9 Mon Sep 17 00:00:00 2001 +From: Jeriko One +Date: Thu, 16 Nov 2017 17:05:42 -0800 +Subject: [PATCH] Sanitize xname in read_ndx_and_attrs. + +--- + rsync.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/rsync.c b/rsync.c +index b82e598..a0945ba 100644 +--- a/rsync.c ++++ b/rsync.c +@@ -49,6 +49,7 @@ extern int flist_eof; + extern int file_old_total; + extern int keep_dirlinks; + extern int make_backups; ++extern int sanitize_paths; + extern struct file_list *cur_flist, *first_flist, *dir_flist; + extern struct chmod_mode_struct *daemon_chmod_modes; + #ifdef ICONV_OPTION +@@ -396,6 +397,11 @@ int read_ndx_and_attrs(int f_in, int f_out, int *iflag_ptr, uchar *type_ptr, + if (iflags & ITEM_XNAME_FOLLOWS) { + if ((len = read_vstring(f_in, buf, MAXPATHLEN)) < 0) + exit_cleanup(RERR_PROTOCOL); ++ ++ if (sanitize_paths) { ++ sanitize_path(buf, buf, "", 0, SP_DEFAULT); ++ len = strlen(buf); ++ } + } else { + *buf = '\0'; + len = -1; +-- +1.9.1 +