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

Remove setgid and setuid programs #96

Open
robnagler opened this issue Jan 29, 2021 · 2 comments
Open

Remove setgid and setuid programs #96

robnagler opened this issue Jan 29, 2021 · 2 comments

Comments

@robnagler
Copy link
Member

robnagler commented Jan 29, 2021

Need to strip setgid and setuid permissions from /usr. sudo and su need to be controlled to be on only during the build.

Docker allows privilege escalation even when --user is supplied.

@robnagler robnagler self-assigned this Jan 29, 2021
@robnagler robnagler removed their assignment Mar 14, 2022
@robnagler robnagler changed the title Remove setgid and setuid programs 20230630 Remove setgid and setuid programs Oct 19, 2022
@e-carlin
Copy link
Member

Another reason to remove setuid programs. Not sure if we're vulnerable to this actual attack. But I found the attack interesting and a reminder of the dangers of setuid.

https://www.openwall.com/lists/oss-security/2022/12/21/3

@robnagler
Copy link
Member Author

systemd-coredump in userspace

I have never liked systemd's cavalier approach to permissions. This is yet another example.

With 'sudo' this will not work, because it actively sets the ulimit for
coredumps to 0. The reason for this is to protect against exactly this
attack scenario [3].

With 'su' it works, however.

We are vulnerable outside Docker containers. Since we run almost everything in Docker, I think we are safe, since we don't set passwords in Docker. The exploit allows extraction of a password hash (not just root).

Still important to disable setuid programs.

@robnagler robnagler changed the title 20230630 Remove setgid and setuid programs Remove setgid and setuid programs Apr 17, 2023
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

2 participants