theflea912 Posted March 25, 2006 Share Posted March 25, 2006 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');?> Quote Link to comment https://forums.phpfreaks.com/topic/5739-mail-security/ Share on other sites More sharing options...
naseermughal Posted March 25, 2006 Share Posted March 25, 2006 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); Quote Link to comment https://forums.phpfreaks.com/topic/5739-mail-security/#findComment-20484 Share on other sites More sharing options...
Hooker Posted March 25, 2006 Share Posted March 25, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/5739-mail-security/#findComment-20489 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.