diff --git a/includes/account.php b/includes/account.php index 96d6213..dc9b8a4 100644 --- a/includes/account.php +++ b/includes/account.php @@ -56,9 +56,7 @@ showfooter(); exit; } - $rnd = fopen("/dev/urandom", "r"); - $hash = md5(fgets($rnd, 64)); - fclose($rnd); + $hash = make_hash(); $query = "insert into `email` set `email`='".$_REQUEST['email']."',`memid`='".$_SESSION['profile']['id']."',`created`=NOW(),`hash`='$hash'"; mysql_query($query); $emailid = mysql_insert_id(); @@ -438,10 +436,7 @@ exit; } - $rnd = fopen("/dev/urandom", "r"); - $hash = md5(fgets($rnd, 64)); - fclose($rnd); - + $hash = make_hash(); $query = "insert into `domains` set `domain`='".mysql_real_escape_string($_SESSION['_config']['domain'])."', `memid`='".$_SESSION['profile']['id']."',`created`=NOW(),`hash`='$hash'"; mysql_query($query); @@ -883,23 +878,23 @@ if($oldid == 13 && $_REQUEST['process'] != "") { - $_SESSION['_config']['user']['fname'] = trim(mysql_real_escape_string(stripslashes($fname))); - $_SESSION['_config']['user']['mname'] = trim(mysql_real_escape_string(stripslashes($mname))); - $_SESSION['_config']['user']['lname'] = trim(mysql_real_escape_string(stripslashes($lname))); - $_SESSION['_config']['user']['suffix'] = trim(mysql_real_escape_string(stripslashes($suffix))); + $_SESSION['_config']['user']['fname'] = trim(mysql_real_escape_string(stripslashes(strip_tags($fname)))); + $_SESSION['_config']['user']['mname'] = trim(mysql_real_escape_string(stripslashes(strip_tags($mname)))); + $_SESSION['_config']['user']['lname'] = trim(mysql_real_escape_string(stripslashes(strip_tags($lname)))); + $_SESSION['_config']['user']['suffix'] = trim(mysql_real_escape_string(stripslashes(strip_tags($suffix)))); $_SESSION['_config']['user']['day'] = intval($day); $_SESSION['_config']['user']['month'] = intval($month); $_SESSION['_config']['user']['year'] = intval($year); - $_SESSION['_config']['user']['Q1'] = trim(mysql_real_escape_string(stripslashes($Q1))); - $_SESSION['_config']['user']['Q2'] = trim(mysql_real_escape_string(stripslashes($Q2))); - $_SESSION['_config']['user']['Q3'] = trim(mysql_real_escape_string(stripslashes($Q3))); - $_SESSION['_config']['user']['Q4'] = trim(mysql_real_escape_string(stripslashes($Q4))); - $_SESSION['_config']['user']['Q5'] = trim(mysql_real_escape_string(stripslashes($Q5))); - $_SESSION['_config']['user']['A1'] = trim(mysql_real_escape_string(stripslashes($A1))); - $_SESSION['_config']['user']['A2'] = trim(mysql_real_escape_string(stripslashes($A2))); - $_SESSION['_config']['user']['A3'] = trim(mysql_real_escape_string(stripslashes($A3))); - $_SESSION['_config']['user']['A4'] = trim(mysql_real_escape_string(stripslashes($A4))); - $_SESSION['_config']['user']['A5'] = trim(mysql_real_escape_string(stripslashes($A5))); + $_SESSION['_config']['user']['Q1'] = trim(mysql_real_escape_string(stripslashes(strip_tags($Q1)))); + $_SESSION['_config']['user']['Q2'] = trim(mysql_real_escape_string(stripslashes(strip_tags($Q2)))); + $_SESSION['_config']['user']['Q3'] = trim(mysql_real_escape_string(stripslashes(strip_tags($Q3)))); + $_SESSION['_config']['user']['Q4'] = trim(mysql_real_escape_string(stripslashes(strip_tags($Q4)))); + $_SESSION['_config']['user']['Q5'] = trim(mysql_real_escape_string(stripslashes(strip_tags($Q5)))); + $_SESSION['_config']['user']['A1'] = trim(mysql_real_escape_string(stripslashes(strip_tags($A1)))); + $_SESSION['_config']['user']['A2'] = trim(mysql_real_escape_string(stripslashes(strip_tags($A2)))); + $_SESSION['_config']['user']['A3'] = trim(mysql_real_escape_string(stripslashes(strip_tags($A3)))); + $_SESSION['_config']['user']['A4'] = trim(mysql_real_escape_string(stripslashes(strip_tags($A4)))); + $_SESSION['_config']['user']['A5'] = trim(mysql_real_escape_string(stripslashes(strip_tags($A5)))); if($_SESSION['_config']['user']['Q1'] == "" || $_SESSION['_config']['user']['Q2'] == "" || $_SESSION['_config']['user']['Q3'] == "" || $_SESSION['_config']['user']['Q4'] == "" || @@ -973,9 +968,9 @@ if($oldid == 14 && $_REQUEST['process'] != "") { - $_SESSION['_config']['user']['oldpass'] = trim(mysql_real_escape_string(stripslashes($oldpassword))); - $_SESSION['_config']['user']['pword1'] = trim(mysql_real_escape_string(stripslashes($pword1))); - $_SESSION['_config']['user']['pword2'] = trim(mysql_real_escape_string(stripslashes($pword2))); + $_SESSION['_config']['user']['oldpass'] = trim(mysql_real_escape_string(stripslashes(strip_tags($oldpassword)))); + $_SESSION['_config']['user']['pword1'] = trim(mysql_real_escape_string(stripslashes(strip_tags($pword1)))); + $_SESSION['_config']['user']['pword2'] = trim(mysql_real_escape_string(stripslashes(strip_tags($pword2)))); $id = 14; showheader(_("My CAcert.org Account!")); diff --git a/includes/general.php b/includes/general.php index 4efc038..e056e3d 100644 --- a/includes/general.php +++ b/includes/general.php @@ -20,6 +20,9 @@ session_register("signup"); session_register("lostpw"); + if($_SESSION['profile']['id'] > 0) + session_regenerate_id(); + $junk = array(_("Face to Face Meeting"), _("Trusted Third Parties"), _("Thawte Points Transfer"), _("Administrative Increase"), _("CT Magazine - Germany"), _("Temporary Increase"), _("Unknown")); diff --git a/includes/general_stuff.php b/includes/general_stuff.php index 3419227..0b8e6fc 100644 --- a/includes/general_stuff.php +++ b/includes/general_stuff.php @@ -70,7 +70,8 @@ google_color_border = "FFFFFF";