Anonymous user can view restricted data

Loading

If anonymous (non-authenticated) users can view data or access pages that are meant to be restricted to logged-in users, it’s a critical security issue in Power Pages. This can expose sensitive information unintentionally and defeat the purpose of role-based access.

This guide provides a step-by-step explanation on how to identify the root cause and prevent anonymous access to protected data in Power Pages.


Root Causes

  1. Incorrect Entity Permission Configuration
  2. Missing or Loose Web Page Access Control Rules
  3. Web Role assigned to Anonymous Users
  4. Entity List or Form not restricted properly
  5. Caching issue showing stale data
  6. JavaScript-based access control (which is not secure)

Step-by-Step Troubleshooting and Solution

Step 1: Identify the Affected Entity/List/Page

  • Determine where the anonymous user can see restricted content:
    • Is it an Entity List?
    • Is it a Web Page that was supposed to be behind login?
    • Is it a custom page using Liquid or FetchXML?

Step 2: Check Web Page Access Control Rules

  1. Open Portal Management App
  2. Navigate to Web Pages
  3. Open the specific Web Page
  4. Scroll to Access Control Rules
  5. Confirm it’s set to:
    • Restrict Read Access
    • Associated with the correct Web Role (e.g., Authenticated Users)

If there’s no rule, the page is publicly accessible.


Step 3: Check Entity Permissions

  1. Go to Entity Permissions in the Portal Management App
  2. Locate the permission assigned to the entity shown on the page
  3. Confirm:
    • Scope is correct (Global, Contact, Account, etc.)
    • Privileges include only what’s needed (e.g., Read)
    • Web Role is not set to Anonymous Users

If “Anonymous Users” is listed here, remove it immediately to block public access.


Step 4: Validate Entity List Settings

  1. Go to Entity Lists
  2. Open the specific list in question
  3. Scroll to the Entity Permissions section
  4. Make sure:
    • It’s checked: Enable Entity Permissions
    • Permission is correctly linked to a non-anonymous role

If “Enable Entity Permissions” is unchecked, the list will be accessible to anyone.


Step 5: Check Entity Form Settings

If the issue involves a form:

  1. Go to Entity Forms
  2. Open the relevant form
  3. Ensure “Enable Entity Permissions” is turned on
  4. Verify the linked permission is not accessible by Anonymous Users

Step 6: Inspect Web Role Assignments

Make sure:

  • Web Roles such as Authenticated Users, Admins, Employees, etc., are not assigned to Anonymous Users
  • Navigate to Web Roles and confirm Anonymous Users is not linked with restricted permissions

Step 7: Look for JavaScript-Based Restrictions

If visibility or access control is implemented via JavaScript (e.g., hiding sections if not logged in), that is not secure.

Avoid this:

if (!user.loggedIn) {
document.getElementById("secret-section").style.display = "none";
}

Why? – The data is already delivered to the browser and just hidden. It can be viewed by inspecting the HTML.


Step 8: Clear Cache

After making permission or role changes:

  • Clear portal cache using: https://<your-portal>.powerappsportals.com/_services/about
  • Or, go to Portal Management > Portal Actions > Clear Config Cache
  • Ask user to log out/in again

Best Practices to Prevent This

  • Always enable Entity Permissions on all lists/forms showing Dataverse data
  • Never assign restricted Entity Permissions to Anonymous Users
  • Use Access Control Rules on Web Pages that should be private
  • Use Web Roles and test access by logging in as different roles
  • Periodically audit all Entity Permissions, Web Roles, and Page Rules
  • Document and standardize access requirements during development

Example Scenario

Let’s say a support ticket list is showing to public users.

Fix:

  1. Go to Entity Lists > Open “Support Tickets”
  2. Ensure Entity Permission is enabled
  3. Check the linked permission is assigned to Authenticated Users
  4. Open Entity Permissions > Confirm “Support Ticket” has no permission for Anonymous Users
  5. Open Web Page > Assign Access Control Rule to hide page from anonymous access
  6. Clear cache and retest

Leave a Reply

Your email address will not be published. Required fields are marked *