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

Possible privilege escalation vulnerability in the Automatic Shutdown feature #6

Open
beomusxyz opened this issue Jan 21, 2022 · 3 comments

Comments

@beomusxyz
Copy link

The feature is an excellent idea, and i absolutely love it, but second i saw the NOPASSWD option i instantly thought about how i could exploit something like that. Anything user writeable and root executable is a super easy way to do local privilege escalation, hell, i've done it before. Honestly that is the only thing stopping me from putting this on my daily driver laptop right now..

[username] [hostname] =NOPASSWD: /usr/bin/systemctl poweroff
 [username] [hostname] =NOPASSWD: /usr/bin/shutdown -h now
@coffebar
Copy link

coffebar commented Feb 2, 2022

@D1sturbing
Hi, i believe on most systems we can run such command without root privileges and without edition a sudoers file
/usr/bin/systemctl poweroff -i

I have this binding in my i3 config on arch and it works fine without any configuration from my side. This line was copy-pasted from somewhere, i think flag -i means something like "ignore locks, force shutdown"

@beomusxyz
Copy link
Author

Just tested this, it does indeed work. I think i'll fill out a pull request now

@beomusxyz
Copy link
Author

Just so happened that i distrohopped.. now i need to find a way to do that with the runit init system...

@beomusxyz beomusxyz reopened this Feb 20, 2022
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