Skip to content

Running WWW Services As Root: Not a Good Idea

Recently I've registered an account on site that forwards blog RSS-es to Twitter and Facebook accounts. Headers of incoming mail attracted my attention:

Received: from ( [])                                                                                    
 by with ESMTP id 11si7984998ywh.80.2010.;                                                                                
Received: (from root@localhost)                                                                                                                              
 by (8.13.8/8.13.8/Submit) id o1CERcGq004355;                                                                                     

Interesting parts are bolded out. As you can see registering e-mail was sent from root account. Probably the same user id is used for WWW application. That means if you break the WWW application you can gain control over whole server.

The preferred way to implement WWW services is to use account that has low privileges (www-data in Debian) because breaking the service will not threat whole server.