Re: mysterious line in my script - what does it all mean?
- From: "Paul Lalli" <mritty@xxxxxxxxx>
- Date: 19 Dec 2006 12:01:09 -0800
Mumia W. (on aioe) wrote:
On 12/19/2006 11:03 AM, maxwells@xxxxxxxxx wrote:
Randal L. Schwartz wrote:( The last three lines were restored after overly aggressive snipping. )
maxwells> #!/usr/bin/perl -wm writes:
maxwells> use CGI;
maxwells> $query = new CGI;
maxwells> $sender = $query->param('s');
maxwells> $message = $query->param('m');
maxwells> $mailprog = '/usr/lib/sendmail';
maxwells> open(MAIL,"|$mailprog -t");
maxwells> print MAIL "To: donald\@duck.com\n";
maxwells> print MAIL "From: $sender\n";
maxwells> print MAIL "Subject: AJAX Mailer\n\n";
maxwells> print MAIL "$message";
maxwells> close (MAIL);
This code can be used to send arbitrary spam to arbitrary addresses.
Mr. Schwartz, Maxwells' program, in its current form, cannot do what you
say because the To: header is hardcoded.
Mr. W, *you* should never be allowed near a CGI program either. The
above program prints USER-ENTERED DATA in the headers of the mail
message. This data is not verified before being printed. Just because
the *programmer* only put a hard-coded address as a To: header, does
not mean the data will not contain additional headers. You honestly
don't think a user could access this script providing a 's' parameter
of "me@xxxxxxxxxxx\nCC: spam_address@xxxxxxxxxxx" ?
Paul Lalli
.
- Follow-Ups:
- References:
- mysterious line in my script - what does it all mean?
- From: maxwells
- Re: mysterious line in my script - what does it all mean?
- From: Randal L. Schwartz
- Re: mysterious line in my script - what does it all mean?
- From: maxwells
- Re: mysterious line in my script - what does it all mean?
- From: Mumia W. (on aioe)
- mysterious line in my script - what does it all mean?
- Prev by Date: How to access elements of an arrya refereneced in a hash of hashes?
- Next by Date: FAQ 4.23 How do I find matching/nesting anything?
- Previous by thread: Re: mysterious line in my script - what does it all mean?
- Next by thread: Re: mysterious line in my script - what does it all mean?
- Index(es):
Relevant Pages
|