開発者は、システム内に存在する ContactSearch Apex クラスのセキュリティ レビューを実行するように指示されています。開発者は、クラス内で次のメソッドをセキュリティ上の脅威として特定しました。 ist<連絡先> performSearch (String lastName} [ return Database.query('SELECT Id, FirstName, LastName FROM Contact WHERE LastName Like s'+lastName+'s'")?; 開発者がメソッドを更新して SOQL インジェクション攻撃を防ぐ 2 つの方法は何ですか? 2つの回答を選択してください
正解:A,B
* Option A: Using variable binding eliminates the need for concatenating dynamic values in the query, which is the safest approach. * Option B: Using String.escapeSingleQuotes ensures special characters are handled safely, reducing the risk of SOQL injection. * Not Suitable: * Option C: While with sharing ensures sharing rules are applied, it does not prevent SOQL injection. * Option D: Regular expressions are not a reliable method for sanitizing input.