Public access to the /api/assets endpoint in Adobe Experience Manager

This article explains how to secure the /api/assets endpoint in Adobe Experience Manager (AEM) publish environments to prevent anonymous users from accessing Digital Asset Management (DAM) metadata unless explicitly intended.

Description description

Environment

  • Adobe Experience Manager (AEM) publish environments

Issue/Symptoms

  • The /api/assets endpoint is accessible to anonymous users by default.
  • DAM folder and asset metadata can be retrieved as JSON by anyone with anonymous READ permission.
  • Internal or sensitive asset metadata is unintentionally exposed to the public.

Cause

By default, the /api/assets endpoint allows anonymous access if the anonymous user has READ permission on DAM assets. Without proper restrictions, this leads to unintended exposure of asset metadata.

Resolution resolution

To secure access to the /api/assets endpoint , follow these steps:

  1. Determine if any external application or integration requires anonymous access to /api/assets on your publish environment. If not, proceed to block access. If access is required, configure authentication.

  2. To require authentication for /api/assets:

    1. Update the Apache Sling Authentication Service OSGiconfiguration on your publish environment to include the following requirement:
      1. Add/api/assets to the sling.auth.requirements property.
    2. Adjust your Dispatcher configuration to allow authenticated JSON traffic to /api/assetsfor integrations that require it
      1. Add an allow rule for GET requests to /api/assets with the .json extension.
    3. Ensure that any technical or service users used by integrations have the necessary read permissions on /api/assets.
  3. To block /api/assetswhen it isn’t required externally:

    1. Add a deny rule for /api/assets in your Dispatcher filter configuration after your allow rules.
    2. Use a deny-by-default allowlist model in Dispatcher for stronger security.
  4. Review DAM folder permissions to ensure the anonymous user only has read access to intended public folders. Remove read access from internal or sensitive folders.

  5. Deploy configuration changes according to your environment’s deployment process.

  6. Test in a non-production environment before deploying to production. Flush the Dispatcher cache and verify that anonymous requests to /api/assets are either blocked or require authentication (returning 401/403errors as appropriate).

recommendation-more-help
experience-cloud-kcs-help-kbarticles