Sub topic 3
What the Security Review covers and what it does not
This chapter assumes you can work in Setup, know what a profile and a permission set are, and have used a sandbox. You do not need to read Apex, but a few short samples show what reviewers look for.
By the end you should be able to say what a "Security Review passed" badge tells you, what it leaves open, and which checks remain your job.
What the Security Review is
The AppExchange Security Review is a process run by Salesforce's partner security team. A publisher (the company that lists the app) must pass it before a solution can be listed publicly on AppExchange. The review looks at the solution's code and architecture for security flaws, and Salesforce can ask the publisher to fix findings before approval.
It has several parts:
- Automated scanning. Static analysis of the package code, plus dynamic scanning of any web application or external service the solution talks to.
- Manual testing. Security engineers probe the solution for issues that scanners miss, such as broken access checks.
- A questionnaire. The publisher documents how the solution handles data, which external endpoints it calls, and how it stores credentials.
- Remediation. The publisher must fix or justify each finding before approval.
Salesforce changes the exact tooling and requirements over time. Treat the details above as the general shape, and read the current partner security documentation if you need specifics.
What the review checks
Reviewers focus on vulnerability classes that put a customer's org or data at risk. The common ones are:
| Area | What reviewers look for | Why it matters to you |
|---|---|---|
| Injection | SOQL injection and other injection flaws in dynamic queries | Attackers could read data they should not see |
| Cross-site scripting (XSS) | Unescaped user input rendered in pages and components | A script could run with your user's session |
| Cross-site request forgery (CSRF) | State-changing actions that can be triggered by a forged request | A user could be tricked into changing data |
| Object and field security | Whether code enforces the running user's CRUD and field-level security (FLS) | The app could expose fields your profiles hide |
| Sharing | Use of `with sharing`, `without sharing`, and record access | The app could show records outside a user's access |
| Secrets and transport | Hard-coded credentials, unencrypted connections, weak token handling | Credentials could leak or be intercepted |
| Insecure external services | Weaknesses in the publisher's web servers and APIs that the solution depends on | Your data leaves Salesforce and lands there |
Here is what a reviewed pattern looks like in Apex. This method uses a bind variable and runs the query in user mode, so object and field security apply to the person calling it.
public with sharing class AccountSearch {
@AuraEnabled(cacheable=true)
public static List<Account> findByName(String term) {
String pattern = '%' + term + '%';
return [
SELECT Id, Name
FROM Account
WHERE Name LIKE :pattern
WITH USER_MODE
LIMIT 50
];
}
}A reviewer would flag the opposite pattern. It concatenates input into a query string and runs in system mode:
public without sharing class UnsafeSearch {
public static List<Account> findByName(String term) {
// Flagged: the input is concatenated into the query,
// and the class ignores the caller's sharing rules.
String q = 'SELECT Id, Name FROM Account WHERE Name LIKE \'%' + term + '%\'';
return Database.query(q);
}
}An app that passed review should not contain the second pattern in code the review covered. That is a real signal, but it is only a signal about the code that was examined.
Where the guarantee stops
A passed review means a specific version of a specific solution, at a specific time, met Salesforce's security requirements. It does not mean Salesforce has certified the app as safe, correct, or suitable for you. The gaps fall into five groups.
Scope and time
- The review covers a version. Publishers release new versions after approval. Salesforce re-reviews solutions periodically and can require review for significant changes, but you should not assume every release was individually examined. Check how recent the listing's review status is and what the publisher says about its release process.
- The review covers a defined scope. A solution that sends data to an external service is only reviewed along with that service if the service is part of the submission. Anything the publisher adds to its backend later changes your risk without any change in your org.
- Approval is a point-in-time result. A new vulnerability class, a changed dependency, or a compromised publisher account can appear after the review. The badge does not update itself to reflect that.
Security is not the same as quality
The review does not test whether the app does what its listing says. It does not measure:
- Business logic correctness, such as whether a commission calculation is right.
- Performance and governor limit use, for example Apex that runs slowly in bulk loads.
- Uptime and support responsiveness.
- Whether the app conflicts with your triggers, flows, validation rules, or other packages.
A secure app can still break your quote process or push your org toward limits. Your sandbox testing covers these issues, as the sandbox chapter explains.
Compliance and data handling
- Regulatory fit is not certified. A passed review does not mean the app meets GDPR, HIPAA, PCI DSS, or your industry's rules. Publishers may hold separate certifications, and you should ask for the evidence.
- Data residency and retention are the publisher's policy. Where an external service stores your data, how long it keeps it, and who at the publisher can see it are matters for the contract and the privacy documentation.
- Sub-processors are outside your view. The publisher may pass data to other vendors.
What you configure
The review cannot decide how you install and assign the app. Overbroad permissions are the most common way a secure app causes a problem. Examples:
- Installing for all users when only a team needs it.
- Granting "Modify All Data" through a permission set because setup was easier that way.
- Leaving a connected app's OAuth scopes wider than the integration needs.
The review also cannot see your data model. A field that is harmless in a demo org may hold regulated data in yours.
Packages that were not reviewed
Not everything you can install went through this process. Unlisted packages shared by direct link, internal packages from a consultant, and sample code from a blog may never have been reviewed. Unmanaged packages deliver their code into your org as editable components, so you can read them, but nobody has vouched for them. The next chapter, on managed and unmanaged packages, covers the differences.
Reading the review signal in a listing
Use the review status as one input among several, and look for details that help you decide.
- Confirm the listing is on AppExchange itself, not a link in an email that leads to a package install URL.
- Check what the listing says about review. Look for statements about the Security Review and about which components it applies to. Some listings include several products, and the review status may differ between them.
- Look for the publisher's own security material. A security whitepaper, a trust page, penetration test summaries, and a named contact for vulnerability reports show a mature process.
- Read the release notes. Frequent releases with clear notes suggest an active publisher. Long silence on a package that touches sensitive data deserves a question.
- Ask direct questions. Where does data go, what is stored, who is the sub-processor, and how are security issues disclosed?
Record the answers. When someone asks later why you approved the app, you will have a written basis.
Checking what the review should have constrained
The review covers external connections that belong to the solution, so you should compare the real configuration against what the publisher told you. After installing into a sandbox, list the remote sites the package created. This Salesforce CLI command queries them through the Tooling API:
sf data query --use-tooling-api --target-org my-sandbox \
--query "SELECT SiteName, EndpointUrl, IsActive FROM RemoteProxy"Each row is a domain your org can call out to. An endpoint that does not appear in the publisher's documentation, or a plain http:// URL, is something to ask about before production. Also check Named Credentials, External Credentials, and connected apps in Setup, and compare each against the listing's stated integrations.
Confirm which packages are installed, and at what version:
sf package installed list --target-org my-sandboxIf a later version appears in the listing, read the release notes before upgrading, because the review you relied on may have been for an older version.
Common mistakes
- Treating the badge as an endorsement. The review is a security gate, not a recommendation.
- Assuming reviewed means least-privilege. An app can pass review and still request broad permissions that it legitimately needs. Decide whether you want to grant them.
- Ignoring the external side. Most of the risk for apps that send data out sits in the publisher's own systems and contracts. Salesforce only covers what was in scope.
- Skipping re-checks on upgrade. A new version may add endpoints, objects, or permissions.
- Trusting unlisted packages by default. A package link from a colleague or consultant has no review behind it unless someone shows you evidence.
Putting it into practice
When you evaluate an app, ask three questions in order:
- What exactly was reviewed, and when? Version, scope, and date.
- What was outside that review that matters for my data? External services, compliance, contract terms.
- Which of the remaining risks do I handle through sandbox tests, install options, permission sets, and monitoring?
The answers decide how much testing and restriction an app needs. A narrow app with a recent review and no external calls might need a modest trial. An app that syncs sensitive records to the publisher's servers needs legal review, a vendor assessment, and a tightly scoped rollout, whatever its review status.
Exercise
A publisher's listing says the app passed the AppExchange Security Review. Name three things the review does not tell you, and what you would do about each before installing in production.
Show answer
Any three of the following. (1) Whether the app behaves correctly with your data and automation: install in a sandbox and test realistic scenarios. (2) Whether it meets your compliance needs or where the publisher stores your data: ask for certifications, privacy documentation, and sub-processor lists, and involve legal or security staff. (3) Whether later versions remain secure: check the version and review date, read release notes, and test upgrades in a sandbox first. (4) Whether your install options and permissions are least-privilege: choose "admins only" or specific profiles, and grant access with narrow permission sets. (5) Whether the external endpoints match the documentation: query remote sites and review named credentials and connected apps after the sandbox install.
Exercise
Why is this Apex pattern a problem even if the package it ships in was reviewed in the past? String q = 'SELECT Id FROM Contact WHERE Email = \'' + input + '\''; Database.query(q); What would you change?
Show answer
It concatenates user input into a dynamic SOQL string, which allows SOQL injection. A review covers the code as submitted, and a later version could introduce the pattern without a new review of that release. Replace it with a static query using a bind variable, for example [SELECT Id FROM Contact WHERE Email = :input WITH USER_MODE], so that the input is treated as data and the caller's object and field access is enforced.