Jump to content

please test for security!


ricmetal

Recommended Posts

  • Replies 127
  • Created
  • Last Reply

Top Posters In This Topic

<?php

$pwd=trim(strip_tags(mysql_real_escape_string(htmlspecialchars($_POST['pwd'])));
$pwd.=md5($pwd);
$email=trim(strip_tags(mysql_real_escape_string(htmlspecialchars($_POST['email'])));
if(!empty($pwd)||isset($pwd)||isset($email)||!empty($email)){ //submit
} else{

//error
}
?>

if you did your validation right you wouldnt have those failures :P

Link to comment
Share on other sites

Then its not the application that has the errors its the redirection either by server or application.

SQL Inject Me is flagging that up as just an unexpected response not a SQL injection vulnerability.

 

p.s. Don't use SQL inject me

Link to comment
Share on other sites

Well if a number of ppl r using automated scans, thats thousands of requests.

hosting accounts gives limited bandwidth to users and each request uses a very minor amount of bandwidth.

 

A few scans shouldn't damage your bandwidth usage but try and resort to manual testing.

Link to comment
Share on other sites

 

your fix:

<?php

$pass1= trim(mysql_real_escape_string(strip_tags(htmlspecialchars($_POST['pass1']))));
$pass1.= md5($pass1);
$pass2= trim(mysql_real_escape_string(strip_tags(htmlspecialchars($_POST['pass2']))));
$pass2.= md5($pass2);
$user_code= trim(mysql_real_escape_string(strip_tags(htmlspecialchars($_POST['user_code']))));

if(!empty($pass1)||!empty($pass2)||!empty($user_code)||isset($pass1)||isset($pass2)||isset($user_code)){
//submit
}else{ //error
}

?>

Link to comment
Share on other sites


×
×
  • 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.