[openssh-commits] [openssh] 03/08: upstream: resist that return ".." via remote glob during

git+noreply at mindrot.org git+noreply at mindrot.org
Mon Jun 29 12:21:30 AEST 2026


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 36480181fa22f98e180b4f9e10203480c0346c78
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Sun Jun 28 23:47:16 2026 +0000

    upstream: resist that return ".." via remote glob during
    
    remote/remote copies, similar to fixes for bz3871 for remote/local copies.
    From Swival scanner
    
    OpenBSD-Commit-ID: c0c20a1b746db55c08e53658bf21ea9405b300a5
---
 scp.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scp.c b/scp.c
index 621db83c0..28ac7a29d 100644
--- a/scp.c
+++ b/scp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scp.c,v 1.274 2026/04/29 22:22:10 djm Exp $ */
+/* $OpenBSD: scp.c,v 1.275 2026/06/28 23:47:16 djm Exp $ */
 /*
  * scp - secure remote copy.  This is basically patched BSD rcp which
  * uses ssh to do the data transfer (instead of using rcmd).
@@ -2039,6 +2039,10 @@ throughlocal_sftp(struct sftp_conn *from, struct sftp_conn *to,
 			goto out;
 		}
 
+		/* Special handling for source of '..' */
+		if (strcmp(filename, "..") == 0)
+			filename = "."; /* Download to dest, not dest/.. */
+
 		if (targetisdir)
 			abs_dst = sftp_path_append(target, filename);
 		else

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list