Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

(ichimunki) Re: E-mail Redirect (for protecting addresses from E-mail-Address-Collecting Bots)

by ichimunki (Priest)
on Jun 25, 2001 at 22:41 UTC ( [id://91382]=note: print w/replies, xml ) Need Help??


in reply to E-mail Redirect (for protecting addresses from E-mail-Address-Collecting Bots)

I wouldn't use this for security reasons (not to mention that it may not foil a decent spider because it does eventually produce the correct mailto: URL).

Use the CGI interface to get the parameters from the URL rather than $ENV, especially since you're pulling in the module anyways (I see this is much better now).

Use taint mode, just to be safe-- and I see that it's there, but you are untainting almost anything that might get passed in.

Don't allow non-word characters in your input variables-- they aren't necessary in an email address are they?

You don't even need to put the domain as "foo.com", just "foo" will be fine, then you can append ".com" in your script.

Final thought: why even allow for input variables... this is the cause of the security problems. Why not just hardcode your own address into the script, so that the rest of us will not start pointing to your script for our own email addresses?
  • Comment on (ichimunki) Re: E-mail Redirect (for protecting addresses from E-mail-Address-Collecting Bots)

Replies are listed 'Best First'.
Re: (ichimunki) Re: E-mail Redirect (for protecting addresses from E-mail-Address-Collecting Bots)
by khippy (Scribe) on Sep 06, 2001 at 13:23 UTC
    Hi ichimunki,

    "Don't allow non-word characters in your input variables-- they aren't necessary in an email address are they?"

    ...is what you are asking, take a look at this: sender@registry-A.registry-1.organization-X which is cut from rfc822. I have seen emailaddresses containing numbers and underscores, too. Emailaddresses definitely don't have to consist out of word-elements.



    --
    there are no silly questions
    killerhippy
      You are absolutely correct. Any detainting regex should allow @ - and . which are non-word characters that are found in valid email addresses. But only in specific forms. Numbers and underscores will match \w in RE, so those don't need to be considered separately.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://91382]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2024-04-24 15:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found