openssh/openssh-9.9p1-scp-clear-setuid.patch
Zoltan Fridrich 4ca20e1c2c Fix CVE-2026-35385
Fix privilege escalation via scp legacy protocol
when not in preserving file mode

Resolves: RHEL-164740

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
2026-04-07 16:33:04 +02:00

16 lines
381 B
Diff

diff --color -ruNp a/scp.c b/scp.c
--- a/scp.c 2026-04-07 15:54:11.193730842 +0200
+++ b/scp.c 2026-04-07 15:55:52.529425481 +0200
@@ -1705,8 +1705,10 @@ sink(int argc, char **argv, const char *
setimes = targisdir = 0;
mask = umask(0);
- if (!pflag)
+ if (!pflag) {
+ mask |= 07000;
(void) umask(mask);
+ }
if (argc != 1) {
run_err("ambiguous target");
exit(1);