Date: Tue, 15 Jan 2019 09:00:12 -0800 (PST) From: "Rodney W. Grimes" <freebsd@pdx.rh.CN85.dnsmgr.net> To: Ed Maste <emaste@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343043 - head/crypto/openssh Message-ID: <201901151700.x0FH0Crl041083@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201901151535.x0FFZE94018787@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> Author: emaste > Date: Tue Jan 15 15:35:14 2019 > New Revision: 343043 > URL: https://svnweb.freebsd.org/changeset/base/343043 > > Log: > scp: disallow empty or current directory > > Obtained from: OpenBSD scp.c 1.198 > Security: CVE-2018-20685 > Sponsored by: The FreeBSD Foundation Can this be MFCed to 12, 11 and 10? > > Modified: > head/crypto/openssh/scp.c > > Modified: head/crypto/openssh/scp.c > ============================================================================== > --- head/crypto/openssh/scp.c Tue Jan 15 09:48:18 2019 (r343042) > +++ head/crypto/openssh/scp.c Tue Jan 15 15:35:14 2019 (r343043) > @@ -1106,7 +1106,8 @@ sink(int argc, char **argv) > SCREWUP("size out of range"); > size = (off_t)ull; > > - if ((strchr(cp, '/') != NULL) || (strcmp(cp, "..") == 0)) { > + if (*cp == '\0' || strchr(cp, '/') != NULL || > + strcmp(cp, ".") == 0 || strcmp(cp, "..") == 0) { > run_err("error: unexpected filename: %s", cp); > exit(1); > } > > -- Rod Grimes rgrimes@freebsd.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901151700.x0FH0Crl041083>