PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

What vulnerability or issue is the code susceptible to?

Lori is creating a login page using Java on one of her websites with the following code. What
vulnerability or issue is the code susceptible to?
conn = pool.getConnection();
String sql = “select * from user where
username=’” + “’ and password=’” + password +
“’”;
stmt = conn.createstatement();
rs = stmt.executeQuery(sql);
if (rs.next())
{
loggedIn = true;
out.println(“Successfully logged in”);
}
else
{
out.println(“Username and/or password not valid”);
}

What is Malory trying to prevent here?

Malory is creating a webpage in PHP where users will have to logon to gain access to certain
areas of the site. Malory is concerned that malicious users might try to exploit her site, so she
decides to use the following code to prevent some attacks. What is Malory trying to prevent here?
$username = addslashes($_POST[“username”]);
$password = addslashes($_POST[“password”]);


Page 225 of 555« First...102030...223224225226227...230240250...Last »