Svetozar Mihailov writes:

Hello,

Recently I discover email in queue which stays forever and delivers over
and over. The problem was '&' in local part of email address.

Server is Centos 5.7, courier-authlib-0.63.0, courier-0.65.0.


.mailfilter problem line:

cc "!m&[email protected]"

Is '&' are allowed char in email address? If yes, how to escape '&'
in .mailfilter? There is no other problems with 'm&[email protected]'.

Is this the literal statement. Or are you doing a variable expansion, like "cc !$ADDR", where you extract ADDR from some header in the original email.

"!" is just an alias for "$SENDMAIL -f '' <rest>".

The above statement is equivalent to:

/bin/sh -c "$SENDMAIL -f '' m&[email protected]"

The shell interprets the & character as a background execution command, with the rest as a second command to execute next. Hillarity ensues.

Picture perfect example of the potential security holes and exploits, when passing untrusted data originating from unknown sources, namely email content, to the shell.

If that's situation here, what do you think would happen if this pattern picked up an address of ";rm -rf $HOME;@example.com"?


Attachment: pgpGqkY5cQsCd.pgp
Description: PGP signature

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to