The problem isn't 'what could happen' as much as what couldn't happen. I mean,
vi is quite a powerful tool, and using it as a privileged user gives many potential avenues of attack and exploit.
And that's why you shouldn't do it - because you're playing 'block the mousehole' in a big old house.
Anything interactive is 'risky'. Avenues of attack:
- Shell escapes - NOEXEC helps here.
- Editing system config files - there's a bunch of 'obvious' culprits, like
/etc/passwd etc. but there's also places where you could, for example, insert a CGI script into an apache instance and privilege escalate that route. Or modify a script called by
roots crontab. (This is particularly entertaining if they have it NFS mounted!)
- editing system scripts (like the contents of
- Symlink traversal attacks - create a symlink to
/etc/passwd and then edit that to bypass any sort of file whitelisting.
You might as well just give
NOPASSWD: ALL because all you're really relying on is that your users aren't going to do something dumb as root.
Add on the additional point - lots of people have favourite editors. I've used
ed when I had to, and mostly use
vim these days. But not everyone likes them. One of the big advantages of
sudoedit is that it lets you use whatever.