Salesforce OAuth Token

Detects Salesforce OAuth tokens in the two shapes Salesforce's own documentation shows: the opaque access token, which doubles as a session ID and begins with the 15-character org ID (00D...) and an exclamation mark, and the refresh token beginning 5Aep861. An access token gives API access to the org's data as the user who authorised it; a refresh token can be exchanged for new access tokens, so a stolen one gives continuing access to that data over the REST API. JWT-based access tokens, which an app must opt in to, are not covered.

Type
regex
Engine
universal
Confidence
medium
Confidence justification
Medium confidence. The access-token shape is well attested: three examples in Salesforce Help share it exactly (org ID, !, 96-character body) and TruffleHog's production detector pins the same structure, so the org-ID prefix and separator make a chance match unlikely. The refresh-token shape is less certain: one Salesforce example and TruffleHog agree on the 5Aep861 prefix but not on length, and Salesforce's rotation example shows a refresh token with a different beginning. Salesforce publishes examples, not a format specification, and describes its tokens as opaque, so both regexes can go stale without notice; a single token therefore stops at 75 and needs a Salesforce or OAuth term.
Jurisdictions
global
Regulations
Criminal Code Act 1995 (Cth)
Frameworks
CIS Controls, ISO 27001, NIST CSF, SOC 2
Data categories
credentials, security
Scope
narrow
Risk rating
8
Platform compatibility
Purview: Compatible, GCP DLP: Unsupported, Macie: Unsupported, Zscaler: Compatible, CrowdStrike DLP: Unsupported, Palo Alto: Unsupported, Netskope: Unsupported

Pattern

(?-i)(?<![A-Za-z0-9])(00D[A-Za-z0-9]{12}(?:!|%21)[A-Za-z0-9_.]{90,130})(?![A-Za-z0-9_.])

Corroborative evidence keywords

salesforce, force.com, sfdc, access_token, refresh_token, instance_url, session id, api key, api_key, apikey, access key, access token, auth token, authorization, bearer, conn str, connection string, connectionstring, cookie, credential (+40 more)

Proximity: 300 characters

Should match

Should not match

Known false positives

References