The smrsh Program

The sendmail program normally runs any program it finds in the user’s ~/.forward file. A cracker can attack any user, including root, by having permission to modify the user’s ~/.forward file. Consider the following modifications, for example:

\user
|"/usr/ucb/vacation user"                                    ← OK
|"/tmp/x.sh"                                                 ← an attack!
|"cp /bin/sh /home/george/.x; chmod u+s /home/george/.x"     ← an attack!

As an aid in preventing such attacks, V8.1 sendmail first offered the smrsh (sendmail restricted shell) program. V8.7 sendmail offered the FEATURE(smrsh) (Configure to Use smrsh on page 380) as an easy way to install smrsh with your mc configuration file.

Get sendmail, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.