Jump to content


Photo

Mail Security


  • Please log in to reply
2 replies to this topic

#1 theflea912

theflea912
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 25 March 2006 - 02:46 AM

I recently wrote a script that emails the form results to me. I also have a friend who at least acts like he knows PHP and when he looked at the code he said that a command could be entered that would delete the files on the server or on the computor. Is this true? If so, is there a way to correct it or prevent it. The code is below:

------------------------------------------------------------------------

An email has been sent to the Director of Human Resources.
Thank you for apply, you will hear back in a bit.

<?php
$body = "Application Alert!\n\n";
foreach($_POST as $field => $value) {
$body .= sprintf("%s = %s\n", $field, $value);
}

mail("theflea912@gmail.com", "APPLYING PILOT!", $body,
'From: "APPLY" <apply@qantasva.com');
?>

#2 naseermughal

naseermughal
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 25 March 2006 - 06:20 AM

i don't think so.

i have already used this code on different site... and it is working fine.

i.e.
mail($getter, $subject , $body, $header_info);

#3 Hooker

Hooker
  • Members
  • PipPipPip
  • Advanced Member
  • 193 posts
  • LocationWales, UK

Posted 25 March 2006 - 06:47 AM

Theres not an exploit like that around as far as i know, one of the very few mail() exploits is mail injection which works like sql injection and can be avoided by validating user input.. which should always be done anyway, if you wanna know more theres a nice little article here about it:

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--][a href=\"http://securephp.damonkohler.com/index.php/Email_Injection\" target=\"_blank\"]http://securephp.damonkohler.com/index.php/Email_Injection[/a][/quote]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users