2 ms·
> You can absolutely limit user access to a subset of superuser commands. Wasn't that limit basically just a string match? I.e. when you're allowed to do sudo
by 411111111111111 3y ago
> You can absolutely limit user access to a subset of superuser commands.
Wasn't that limit basically just a string match?
I.e. when you're allowed to do sudo abinary the whitelist will accept whatever is behind that string?
So from what I recall, simply adding a new directory to the start of your path will let you execute your own script instead, giving you blanket root permission.
Same with chroot on absolute paths, right?
- autoexec 3y agoA collection of hashes for each specific binary that now needs to be maintained and updated any time one of them changes seems like it'd be more secure, but also a huge pain. I think if an attacker already has access to my system, can install their own binaries, and then run them by specifying paths at the command line, the security of my linux desktop is already a lost cause
- theamk 3y agoNope, sudo uses hardcoded PATH and not user-supplied one. Doing otherwise would be a huge security hole, and would get fixed quickly. It also clears related variables like PYTHONPATH (the exact list depends on distro) In general, sudo is pretty good with single command grants as long as you use this on the scripts made for the purpose (like shell scripts which take no or a single fixed argument). But granting arbitrary arguments permission to a random system binary is a bad idea, something like --log-output might become an escalation. (And unfortunately the default PATH means to of you want to sudo-exe c binaries from your user's bin, you need full path. I hit this all the time.)