Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP4:GA
openssh
openssh-bsc1190975-CVE-2021-41617-authorizedkey...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File openssh-bsc1190975-CVE-2021-41617-authorizedkeyscommand.patch of Package openssh
From cc4beab7fb57e69410a2a7a678bfc59d3218b01c Mon Sep 17 00:00:00 2001 From: Ali Abdallah <aabdallah@suse.de> Date: Wed, 24 Nov 2021 11:28:21 +0100 Subject: [PATCH] CVE-2021-41617 fix backport of the following two upstream commits f3cbe43e28fe71427d41cfe3a17125b972710455 bf944e3794eff5413f2df1ef37cddf96918c6bde CVE-2021-41617 failed to correctly initialise supplemental groups when executing an AuthorizedKeysCommand or AuthorizedPrincipalsCommand, where a AuthorizedKeysCommandUser or AuthorizedPrincipalsCommandUser directive has been set to run the command as a different user. Instead these commands would inherit the groups that sshd(8) was started with. --- auth2-pubkey.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/auth2-pubkey.c b/auth2-pubkey.c index ee1101d..be05b0e 100644 --- a/auth2-pubkey.c +++ b/auth2-pubkey.c @@ -42,6 +42,7 @@ #include <time.h> #include <unistd.h> #include <limits.h> +#include <grp.h> #include "xmalloc.h" #include "ssh.h" @@ -491,6 +492,13 @@ subprocess(const char *tag, struct passwd *pw, const char *command, } closefrom(STDERR_FILENO + 1); + if (geteuid() == 0 && + initgroups(pw->pw_name, pw->pw_gid) == -1) { + error("%s: initgroups(%s, %u): %s", tag, + pw->pw_name, (u_int)pw->pw_gid, strerror(errno)); + _exit(1); + } + /* Don't use permanently_set_uid() here to avoid fatal() */ if (setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) != 0) { error("%s: setresgid %u: %s", tag, (u_int)pw->pw_gid, -- 2.26.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor