I am wondering how much validation is needed (and what other security checks I might need to run) on a field that has a confirmation field. An example of this is a “password” form field that has an associated “confirm your password.”
In my code, I have:
$password = $_POST['password']
$confirmpassword = $_POST['confirmpassword']
if (!$password == $confirmpassword)
{
// give error message
}
But $password itself is highly validated and (I believe) secure. The $confirmpassword is not used other than to be compared to $password, so it is never used in output or used in a database. I could easily duplicate the same code to apply to $confirmpassword, but I thought this might be unnecessary. Should I have any concerns here?