Date: Tue, 15 Jan 2019 15:35:14 +0000 (UTC) From: Ed Maste <emaste@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343043 - head/crypto/openssh Message-ID: <201901151535.x0FFZE94018787@repo.freebsd.org>
next 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 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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901151535.x0FFZE94018787>