Skip to content

Commit

Permalink
ExecHelperMain: fix privilege lowering code
Browse files Browse the repository at this point in the history
  • Loading branch information
FooBarWidget committed May 29, 2018
1 parent 6120509 commit 4e97fdb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/agent/ExecHelper/ExecHelperMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ switchGroup(uid_t uid, const struct passwd *userInfo, gid_t gid) {
if (ngroups <= NGROUPS_MAX) {
setgroupsCalled = true;
gidset.reset(new gid_t[ngroups]);
for (int i = 0; i < ngroups; i++) {
gidset[i] = groups[i];
}
if (setgroups(ngroups, gidset.get()) == -1) {
int e = errno;
fprintf(stderr, "ERROR: setgroups(%d, ...) failed: %s (errno=%d)\n",
Expand Down

4 comments on commit 4e97fdb

@kbabioch
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CVE-2018-12615 has been assigned to this.

@CamJN
Copy link
Contributor

@CamJN CamJN commented on 4e97fdb Jun 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where was this reported? Mitre isn't showing a listing for CVE-2018-12615.

@kbabioch
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was reported through MITRE and will be displayed in the usual places, once it is synced, which usually takes a couple of hours. I've just added the comment as a reference, in case someone will be looking for it in the future.

@kbabioch
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way: While looking at the code we also realized that there might be other issues with the privilege drop, e.g. #2096

Please sign in to comment.