Jump to content

Question about "Mail to friend" and avoiding abuse ...


Recommended Posts

Hi all.

 

I am writing a recipe script and I've decided I'd like the guests to be able to send a recipe they like either to themselves or to others (such as their friends).

 

This is something I would greatly like to have, yet at the same time I am a bit concerned that I am leaving the website open to abuse. As in, I do not want this being used for spamming people.

 

To that end, I have set it up so that the person (*guest*) must first log in before they can use the feature.

 

Then, I have set it up so all they can do is enter an email address. I.e., I wrote the greeting ("Someone thought you'd like this recipe: {recipe name here} and, I also wrote the body, which is basically a description of the recipe, the ingredients and the directions for making it, and at the very bottom, a link which goes back to the actual recipe on the website.

 

So, the user has no control over WHAT is sent, so they can't use the form to send out spam, as far as I know. It is using post data that is already defined.

 

Am I getting into trouble with this? Can spammers somehow change the $body (body of the message) variable which is defined on the processing page and send out something different? There are only 3 variables being passed between the form: username (person sending it), recipe ID (id of the recipe) and email (the email of the person receiving it).

 

Should I implement anything else to make sure it's not abused? I'd really like some suggestions before I let anyone else use the script and come back to me saying they've been labeled as spammers because of this feature.

 

Thanks for any and all advice, really!

 

Maybe you do not understand the semantics of this.

 

No one will be labled as a spammer, As the origin server will always be yours. If I sent your e-mail address 4300 times, would you get penalized? No.

 

The best you can do is disallow them to send recipes more than X amount of times per day/hour. Obviously flagging/disallowing keywords such as .. "Viagra, ..." to be sent will be of use.

 

There is not much harm in any of it really.

 

At the end of the e-mail, State it was sent using the said feature, And if you're worried about spamming add a "Do not send to this address" link at the bottom of each e-mail, It'll be morally correct if you're worried about that.

 

As for your $body being written, How do we know what your script is set up as? We can't tell you what is wrong. But in what I can see only a major flaw in your script will allow them to put arbituary content.

Thanks for the reply ... the reason I am concerned is because this is a script I plan on releasing for others to use. That is why I said I don't want "them" to be considered spammers because of something I wrote, if that makes sense.

 

As for the code, I am using only a single post data variable sent via a form which is cleansed, so my question was really more general, as in, not so much just for my script, but is there a way someone could alter post data that they didn't create themselves via a form entry?

 

I understand how injection occurs, if you simply parse whatever someone enters into a form without cleaning it first, and that part has been taken care of, but if, for example, someone hard codes a variable (I.e. $variable="Hello World!";), could that in any way be altered? If not, I'm fine, I just want to make double sure is all.

 

As to the prevention of sending multiple emails in a row, that, of course, is a great idea and one I should have thought of on my own, thanks.

 

As I said, Unless there were a major security flaw in your script, PHP cannot be talked to by the client, and that variable will always remain static unless the end user of the script was stupid enough to allow access to it. That is a whole other topic, as that can happen on any script in existance, if the end user is stupid enough to do it.

 

Why not put a comment next to the variable and tell them not to change it or whatever? Simple enough.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.