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)- A75% (18)
- B8% (2)
- C4% (1)
- D13% (3)
Community Discussion
No community discussion yet for this question.