# Authorization Differential Testing in Salesforce

DevFeed: [Authorization Differential Testing in Salesforce](<https://devfeed.tech/articles/authorization-differential-testing-in-salesforce-100765.md>)

Original publisher: [Read original article](<https://www.netspi.com/blog/technical-blog/cloud-pentesting/authorization-differential-testing-in-salesforce/>)

Author: Aussan Saad-Ali

Published: 2026-10-26T19:17:06Z

Content type: tutorial

Language: en

Sources: [NetSPI](<https://devfeed.tech/sources/netspi.md>)

Topics: [Authorization](<https://devfeed.tech/topics/authorization.md>), [Access Control](<https://devfeed.tech/topics/access-control.md>), [Hacking](<https://devfeed.tech/topics/hacking.md>), [GraphQL](<https://devfeed.tech/topics/graphql.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [authorization](<https://devfeed.tech/tags/authorization.md>), [cloud-pentesting](<https://devfeed.tech/tags/cloud-pentesting.md>), [custom](<https://devfeed.tech/tags/custom.md>), [differential-testing](<https://devfeed.tech/tags/differential-testing.md>), [graphql](<https://devfeed.tech/tags/graphql.md>), [hidden](<https://devfeed.tech/tags/hidden.md>), [identity](<https://devfeed.tech/tags/identity.md>), [salesforce](<https://devfeed.tech/tags/salesforce.md>), [testing](<https://devfeed.tech/tags/testing.md>), [ui](<https://devfeed.tech/tags/ui.md>)

## AI overview

Authorization Differential Testing compares the same user, record, field, and operation across Salesforce UI API, GraphQL, and custom paths to find inconsistent access enforcement. UI API and GraphQL honor the caller's record, object, and field access in the described tests; custom Apex can differ. `with sharing` enforces record sharing but does not by itself enforce object permissions or field-level security for system-mode database operations. Apex classes at API v66 or earlier default to system mode, while v67 or later default to user context, so an org may contain both behaviors. The excerpt recommends recording each class's API version, sharing declaration, and query or DML mode; testing restricted users and site guests separately against native APIs and reachable Apex methods; and repeating checks after permission changes, API upgrades, or site migrations. Developers can select user mode explicitly or use `Security.stripInaccessible()` when inaccessible fields should be removed.

## Source excerpt

NetSPI Salesforce expert Aussan explores how holding identity steady across UI API, GraphQL, and custom @AuraEnabled Apex methods reveals hidden authorization gaps. The post Authorization Differential Testing in Salesforce appeared first on NetSPI.