Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check return setgroups result for safety #149

Open
theopolis opened this issue Feb 8, 2020 · 0 comments
Open

Check return setgroups result for safety #149

theopolis opened this issue Feb 8, 2020 · 0 comments

Comments

@theopolis
Copy link

Hi, I was reviewing the privilege dropping code and saw that the return from setgroups is not checked.

redsocks/base.c

Line 399 in c3fc945

setgroups(0, NULL);

If this call fails then supplemental groups may not be dropped as intended and this may have security impact. Additionally it might be better to swap setgroups with initgroups for the target user. This makes sure the process gains potentially restrictive groups. In either case if the result is non-0 then the program should fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant