Bugzilla – Bug 33
Possible Bug on sudo + vi
Last modified: 2001-04-11 19:16:30 MDT
When I make sudo vi, then you type :sh to go to shell you gain root access.
This is not a bug in sudo, it is a problem with giving a user access to programs that allow shell escapes (vi is just one of many). If you need to give access to an editor you should use one that has a "secure" mode that disallows running external commands. Both nvi and vim have ways to do this. To quote from the sudo(8) man page "There is no easy way to prevent a user from gaining a root shell if that user has access to commands allowing shell escapes."