nerdexam
EC-Council

312-92 · Question #101

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 *…

The correct answer is A. SQL injection. See the full explanation below for the reasoning.

Question

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"); }

Options

  • ASQL injection
  • BDirectory transversal
  • CSQL slamming
  • DQuery string manipulation

How the community answered

(24 responses)
  • A
    75% (18)
  • B
    8% (2)
  • C
    4% (1)
  • D
    13% (3)

Community Discussion

No community discussion yet for this question.

Full 312-92 Practice