Skip to main content

Experience Cloud self-registration security: what a stranger gets when they sign up

Guest access gets most of the attention in Experience Cloud reviews, and it should. But many sites have a second door that is almost as open: self-registration. If anyone on the internet can create an account, then "authenticated user" means "anyone with an email address". Every permission you granted to signed-in members is effectively granted to the public, after one form.

This post walks through what happens when a visitor self-registers, which settings decide what they can read afterwards, and how to review it. For the unauthenticated side, see our Experience Cloud guest user security checklist.

What happens when someone self-registers

Self-registration is turned on per site in Experience Workspaces, under Administration > Login & Registration. When it is on, a visitor fills in the sign-up page and Salesforce creates:

  1. A contact (or a person account), linked to an account.
  2. An external user for that contact, with a license and a profile.

Three settings on the Login & Registration page decide the result: the profile new users get, the account their contact is linked to, and (for configurable self-registration) the verification method. The code that does the work is the registration handler.

The registration handler

Modern sites use configurable self-registration, backed by an Apex class that implements Auth.ConfigurableSelfRegHandler. Salesforce generates the class, and teams often edit it to fill custom fields or apply their own rules. Older sites may still use a Visualforce controller for registration.

Either way the handler is public code that runs in response to an anonymous request, so review it like one:

  • It must not trust the form for authorization decisions. A form field, hidden field or URL parameter that picks the account, the profile or a "partner" flag lets the visitor choose their own access.
  • It runs with more rights than the visitor. Creating contacts and users takes access a guest does not have. Keep the class small and do nothing else in it.
  • It should reject duplicates and junk before creating anything. Do not assume the platform deduplicates registrants for you.

Here is the kind of edit we see that turns a sign-up form into a privilege selector:

// Before: values typed into the form pick the account and profile
global Id createUser(Id accountId, Id profileId,
        Map<SObjectField, String> registrationAttributes, String password) {
    String acct = registrationAttributes.get(User.Account_Number__c);
    if (String.isNotBlank(acct)) {
        accountId = [SELECT Id FROM Account WHERE AccountNumber = :acct LIMIT 1].Id;
    }
    if (registrationAttributes.get(User.Partner_Code__c) == 'partner') {
        profileId = PARTNER_PROFILE_ID;
    }
    return createCommunityUser(accountId, profileId, registrationAttributes, password);
}

The fixed version keeps the account and profile from the Login & Registration settings, and moves any upgrade to an approval step after sign-up:

// After: account and profile come from configuration only
global Id createUser(Id accountId, Id profileId,
        Map<SObjectField, String> registrationAttributes, String password) {
    // Partner access is granted later by an internal approval, never at sign-up.
    return createCommunityUser(accountId, profileId, registrationAttributes, password);
}

The default account

This setting causes more data exposure than any other. If you choose an account on the Login & Registration page, every self-registered contact is attached to that one account. Salesforce's documentation notes that when the account setting is left blank, person accounts are created instead, if person accounts are enabled.

A single shared account is fine only if nothing grants access by account. In practice, plenty does:

  • Sharing sets grant external users access to records whose account (or contact) matches their own. A sharing set that shares Cases where Case.AccountId equals the user's account gives every self-registered user every case on the shared account, including other strangers' cases.
  • Role-based licenses (such as Customer Community Plus) give users a role under their account, and account-level sharing can then open records owned by other users of the same account.

So the safe patterns are: give each registrant their own account (a person account, or an account your handler creates per registration), or make sure neither sharing sets nor account-based sharing apply to the shared account.

The default profile

The profile on the Login & Registration page is what every new user gets. Treat it as a public profile:

  • Object permissions only for what a brand-new, unverified member needs.
  • Field-level security reviewed field by field, especially on contact, account and case.
  • No access to Apex classes beyond the ones the site's member pages call.
  • No "View All" or "Modify All" on any object.

If some members need more, give them a different profile or a permission set through an internal approval, not through the sign-up path.

Verification and bots

Configurable self-registration lets you require email or SMS verification. When verification is on, the visitor proves control of the address or phone number with a one-time code before the handler creates the user. That does not prove who they are, but it stops throwaway registrations with addresses nobody controls, and it gives you a working contact channel.

For bot protection on a custom or headless registration flow, Salesforce's headless registration supports reCAPTCHA, and the headless identity settings require either reCAPTCHA or authentication before the API can be used. Rate limiting and monitoring new user volume are still worth adding: a sudden spike in external users on one account is a signal.

A review checklist

  1. Is self-registration on for this site, and does the business need it?
  2. Which profile do new users get? Review it as if it were a guest profile.
  3. Which account are they attached to? Is any sharing set or account-based sharing active for it?
  4. Is email or SMS verification required?
  5. Does the handler take any account, profile or role decision from the request?
  6. Which Apex do member pages call, and does each class enforce sharing and FLS?
  7. Is there a process to deactivate dormant or suspicious external users?

How Vulkro for Salesforce checks this

In source, SF-ATTACK-SURFACE-002 lists each Experience Cloud network with self-registration enabled, as an inventory row for a reviewer to confirm, and vulkro-sf exposure reports what an unauthenticated visitor can reach. On a live org:

vulkro-sf org guest-live --target-org my-prod

SF-GUEST-LIVE-001 reports a live site that lets visitors register their own accounts, alongside active guest users and Chatter guest access. See the org guest-live docs and the attack-surface inventory.

FAQ

Is Experience Cloud self-registration secure?

It can be, if the default profile is minimal, new users are not attached to a shared account that sharing sets or roles open up, verification is required and the handler takes no access decision from the form.

What account do self-registered users get in Experience Cloud?

The account chosen on the Login & Registration page. If that setting is blank and person accounts are enabled, Salesforce creates a person account for each registrant.

What does a sharing set do for self-registered users?

It grants external users access to records related to their own account or contact. If every registrant shares one account, a sharing set can expose each registrant's records to all the others.

See Vulkro for Salesforce and Start a 14-day trial. Related: the sharing rule that shares too much and anatomy of a guest user data leak.