Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE ASAP Assuming the following Java servlet code generates query. There is an SQL injection vulnerablity in the generated query (qry). Which of the variable

PLEASE ASAP
image text in transcribed
image text in transcribed
Assuming the following Java servlet code generates query. There is an SQL injection vulnerablity in the generated query (qry). Which of the variable would be responsible for the SQL injection attack? String LoginAction (HttpServletRequest request, ...) throws IOException \{ String sLogin = getParam(request, "Login"): String table = "members"; String col1 = "member_id"; String qry = "select " + col 1+ ", member_level from " + table + " where " + "member_login =" " + sLogin + "w"; col1 table sLogin none of the above PreparedStatement can be used to remove SQL Injection from Java code. Below is the statement of a Java query that takes an input (user) and needs to be transalted to PreparedStatement to secure. String qry = "select from t1 where uid =+ user +; Which of the following statement(s) convert above query into a safe query? See Java manual on PreparedStatement at http://docs.oracle.com/javase/7/docs/api/java/sql/PreparedStatement.html Preparedstatement ps = conn. preparestatenent ( select * fron t1 where uide P"); Preparedstatement ps - conn, preparestatement ( select * from t1 where uidi* + user )j; Preparedstatement iss = conn. preparestatement ( select - fron t1 where uld ?") ; psisetstring(1, user); none of the above

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

=+d. Purchaser: buys the item.

Answered: 1 week ago

Question

Ty e2y Evaluate the integral dy

Answered: 1 week ago