Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Accredited B2B Commerce Developer Professional (AP-202) Exam - Topic 4 Question 94 Discussion

Posted by Bettina on Jun 01, 2026 at 09:25 AM

Although Salesforce B2B Commerce and Salesforce recommend against using

"without sharing classes" whenever possible, sometimes it is unavoidable. Which three

items will open up a major security hole? (3 answers)

Suggested Answer: A, C, D

Executing dynamic SOQL inside a without sharing class with a bind variable from PageReference.getParameters(), PageReference.getCookies(), or cc_RemoteActionContext class will open up a major security hole because these sources of input are not sanitized and can be manipulated by malicious users to inject SOQL queries that bypass the sharing rules and access data that they are not supposed to see. For example, a user can modify the URL parameters or cookies to include a SOQL query that returns sensitive data from the database. To prevent this, it is recommended to use static SOQL or escape the bind variables before executing dynamic SOQL.


Get Premium Salesforce Accredited B2B Commerce Developer Professional (AP-202) Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
17 comments · newest first
MA
Magda 1 month ago
Let's hope the exam reflects our knowledge on this!
SH
Shay 1 month ago
Exactly! We need to be cautious with dynamic SOQL in those classes.
MI
Mi 1 month ago
I feel confident about this. It's all about data protection.
MA
Magda 2 months ago
C is a big no too. Cookies can be manipulated easily.
SH
Shay 2 months ago
Right! B is also risky because UserInfo can reveal sensitive info.
MI
Mi 2 months ago
Definitely A! Using PageReference parameters can expose data.
MA
Magda 2 months ago
Agreed! I think A, B, and C are the major risks.
SH
Shay 2 months ago
This question is tricky. I feel like it's testing our understanding of security.
JA
Janessa 2 months ago
Totally agree with A) and C) being major security holes!
JE
Jenelle 3 months ago
Wait, are we really saying D) is safe? That surprises me!
PO
Portia 3 months ago
C) seems sketchy too, but I’m not sure.
JE
Jeniffer 3 months ago
I think B) is also risky, but not as bad as A).
KR
Kristal 3 months ago
A) is definitely a big no-no!
LE
Leonardo 3 months ago
I recall that using PageReference parameters can expose data, so I’d lean towards A and C being correct, but I need to double-check my notes on that.
AR
Arlene 4 months ago
I’m a bit confused about the implications of using UserInfo as a bind variable. Is it really that risky in a "without sharing" context?
HA
Harrison 4 months ago
I think options A and C sound familiar, but I'm not entirely sure about D. I feel like we practiced a similar question before.
RO
Ronna 4 months ago
I remember discussing how using dynamic SOQL in "without sharing" classes can lead to security risks, especially with user input.
0/2000 characters

Save Cancel