8 messages in net.sourceforge.lists.courier-users[courier-users] Script security (was:...
FromSent OnAttachments
cour...@kaiserdigital.comJan 2, 2002 12:21 pm 
Sam VarshavchikJan 2, 2002 3:32 pm 
cour...@kaiserdigital.comJan 3, 2002 9:17 am 
Sam VarshavchikJan 3, 2002 2:39 pm 
cour...@kaiserdigital.comJan 3, 2002 3:16 pm 
Sam VarshavchikJan 3, 2002 3:29 pm 
Alessandro VeselyJan 4, 2002 4:47 am 
Sam VarshavchikJan 4, 2002 5:05 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[courier-users] Script security (was: Re: IMAP FoldersActions...
From:Alessandro Vesely (ves@tana.it)
Date:Jan 4, 2002 4:47:39 am
List:net.sourceforge.lists.courier-users

Sam, would you please spend a few words on security design in Courier? I mean a who-should-care-about-what overview.

Sam Varshavchik writes:

You can implement this using an intelligent .courier-default file (all on one line):

|| x=`echo "$DEFAULT" | [...snip...]

Haven't also looked at this closely, but it should be safe from envelope-based attacks[...]

Would you please be more explicit on that? I've noticed the destination mailbox is not being fully sanitized before being passed to scripts: special characters apparently pass and I can get something like

Delivered-To: `cat/etc/passwd|sendmail ale`@tana.it

I never got passwd even if the string was used in a shell script, but I don't know if it's just me not being a good hacker or if it's the system being robust.

Another similar point. When I use the escape() function in mailfilters then I should not put the result in double quotes, or some backslash will survive. I guess mailfilter deserves singleescape() and doubleescape() functions, which are not easy to do with full portability. However, there's quite no hype in the docs about escaping and it is not clear if/which security steps will have been taken already when data is passed to the scripts.

TIA Ale