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

agent helper: support separate socket-activated service to run without SETUID #501

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bluca
Copy link
Member

@bluca bluca commented Sep 16, 2024

SETUID binaries are considered harmful, as te execution context is under the control of unprivileged attackers.

Enhance the polkit pam agent helper with a new mode: when running under systemd, add a socket-activated service that the helper will run under, as root. The agent talks to this service via AF_UNIX instead of spawning it, and STDIN/STDOUT are connected as before. The helper can make use of PID FDs and SO_PEERCRED to reliably identify the caller. In order to do this, a third version of the auth D-Bus method is added, that also takes a subject, built using the PID FD.
If the AF_UNIX socket is not present, the agent will fork the helper as before, with no changes.

Fixes #169

@bluca bluca force-pushed the remove_setuid_inet branch 2 times, most recently from adcc469 to f2206c2 Compare September 17, 2024 14:54
…t SETUID

SETUID binaries are considered harmful, as te execution context is
under the control of unprivileged attackers.

Enhance the polkit pam agent helper with a new mode: when running
under systemd, add a socket-activated service that the helper will
run under, as root. The agent talks to this service via AF_UNIX
instead of spawning it, and STDIN/STDOUT are connected as before.
The helper can make use of PID FDs and SO_PEERCRED to reliably
identify the caller. In order to do this, a third version of the
auth D-Bus method is added, that also takes a subject, built using
the PID FD.
If the AF_UNIX socket is not present, the agent will fork the
helper as before, with no changes.

Fixes polkit-org#169
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

Successfully merging this pull request may close these issues.

polkit-agent-helper-1 is setuid root and runnable by ordinary users, does it need to be?
1 participant