Valid CRT-450 Dumps shared by ExamDiscuss.com for Helping Passing CRT-450 Exam! ExamDiscuss.com now offer the newest CRT-450 exam dumps, the ExamDiscuss.com CRT-450 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com CRT-450 dumps with Test Engine here:
A developer is tasked to perform a security review of the ContactSearch Apex class that exists in the system. Whithin the class, the developer identifies the following method as a security threat: List<Contact> performSearch(String lastName){ return Database.query('Select Id, FirstName, LastName FROM Contact WHERE LastName Like %'+lastName+'%); } What are two ways the developer can update the method to prevent a SOQL injection attack? Choose 2 answers
Correct Answer: A,B
Recent Comments (The most recent comments are at the top.)
Durga - Jan 18, 2025
C and D is Correct C. Use the escapeSingleQuote method to sanitize the parameter before its use:
The escapeSingleQuote method is used to sanitize user inputs that might contain special characters like single quotes ('). This is particularly useful in protecting against SOQL injection where malicious input could break the query syntax or alter the intended behavior.
D. Use variable binding and replace the dynamic query with a static SOQL:
Variable binding (also known as bind variables) is a secure method to include variables in a SOQL query. By using bind variables, the Apex runtime automatically escapes the values for you, protecting the query from injection.
yamada - Sep 25, 2022
CD is true C. Use the escapeSingleQuote method to sanitize the parameter before its use. D. Use variable binding and replace the dynamic query with a static SOQL.
Recent Comments (The most recent comments are at the top.)
C and D is Correct
C. Use the escapeSingleQuote method to sanitize the parameter before its use:
The escapeSingleQuote method is used to sanitize user inputs that might contain special characters like single quotes ('). This is particularly useful in protecting against SOQL injection where malicious input could break the query syntax or alter the intended behavior.
D. Use variable binding and replace the dynamic query with a static SOQL:
Variable binding (also known as bind variables) is a secure method to include variables in a SOQL query. By using bind variables, the Apex runtime automatically escapes the values for you, protecting the query from injection.
CD is true
C. Use the escapeSingleQuote method to sanitize the parameter before its use.
D. Use variable binding and replace the dynamic query with a static SOQL.
Correct Answer is C & D
The answer is C & D in my view point.