3 ms·
It is still an issue, since vi/vim gets used for sudo purposes all the time. Any time someone uses visudo to modify their sudoers file, for example, that's givi
by kedean 11y ago
It is still an issue, since vi/vim gets used for sudo purposes all the time. Any time someone uses visudo to modify their sudoers file, for example, that's giving root privileges to vim.
- deleted 11y ago[deleted]
- kragen 11y agoWhen you visudo, you are subjecting vim to (1) your chosen input and (2) the contents of sudoers. If you are malicious, you could choose your input to be ":!", which gives you a root shell. If the contents of sudoers are malicious, they can give root access to whoever they want. So visudo is not a particularly dangerous scenario. Of course, it's possible that some aspect of vim will, say, create a temp file insecurely as root, or read random shit out of /proc, or what have you, and be exploitable. But the historical security problems in vim (and there have been several!) have mostly had to do with editing maliciously-composed files with it.
- kccqzy 11y agoVisudo specifically avoids this problem by creating a copy of the sudoers file, invoke the editor as a normal user, wait for it to exit, check syntax and then rename the temporary file into the actual sudoers file.