4 ms·
Altering the user's environment is a vector around security. I hadn't considered the sudo angle before, but there's a tradition of invoking binaries from their
by michrassena 9y ago
Altering the user's environment is a vector around security. I hadn't considered the sudo angle before, but there's a tradition of invoking binaries from their full path to mitigate the problem. So instead of sudo on its own, you would use /usr/sbin/sudo, and make sure your PATH variable never contains the current directory. Better mitigations disallow executables in users' home folders.
- AstralStorm 9y agoNot really. Attacker can execute their own shell from your profile script. Who knows how it will handle paths. Depending on configuration, this can be prevented with noexec mount, selinux or SMACK. Grsecurity and RSBAC can prevent unwanted exec. Systems like apparmor, or grsecurity MAC, TOMOYO or YAMA do not work against executing wrong executables. IMA (signing and verifying files) can work too. All bets are off in case there is a local root exploit in kernel or any setuid app.