in reply to Security of Sendmail and -T error

You indicate:
# similar untainting for all other user input here, then...
and:
print MAIL "Subject: $subject\n\n";
so it's not clear what kind of checks you're doing on the subject. Depending on those checks, this script may be an open mail relay or not. For example, suppose the subject is set to:
$subject = "Nice subject\nBcc: john@doe.com, jane@doe.com... ";
the mail you send becomes in fact:
From: $name To: $sendto Subject: Nice subject Bcc: john@doe.com, jane@doe.com... Message: $message
and you've just become a spammer.

So, make sure you filter newlines from $subject as well!

Liz

Replies are listed 'Best First'.
Re: Re: Security of Sendmail and -T error
by bradcathey (Prior) on Dec 14, 2003 at 14:12 UTC
    Great tip, liz, thanks! And to your point, I was only filtering out punctuation and not newlines.

    —Brad
    "A little yeast leavens the whole dough."