QuestionQ114Verified/Data and Database SecurityCopy linkReport a problemAsk AstroTutorSave questionWhich of these code snippets could permit SQL injection?Avar name;name= request.form ("name");Bvar name;var name = "Select * from sample_database where name = ' " + name + " ' " ;Cvar name;name= request.form ("name");var SQL = "Select * from sample_database where name = ' " + name + " ' " ;Dvar name;var SQL = "Select * from sample_database where name = ' " + name + " ' " ;Show AnswerAnswerExplanationSQL injection is possible when untrusted request data is directly concatenated into a SQL statement. Retrieving name from request.form and embedding it between SQL string fragments allows an attacker-controlled value to change the statement's syntax or logic.Show comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion