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/assetsendpoint 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:
-
Determine if any external application or integration requires anonymous access to
/api/assetson your publish environment. If not, proceed to block access. If access is required, configure authentication. -
To require authentication for
/api/assets:- Update the Apache Sling Authentication Service OSGiconfiguration on your publish environment to include the following requirement:
- Add
/api/assetsto thesling.auth.requirementsproperty.
- Add
- Adjust your Dispatcher configuration to allow authenticated JSON traffic to
/api/assetsfor integrations that require it- Add an allow rule for GET requests to
/api/assetswith the.jsonextension.
- Add an allow rule for GET requests to
- Ensure that any technical or service users used by integrations have the necessary read permissions on
/api/assets.
- Update the Apache Sling Authentication Service OSGiconfiguration on your publish environment to include the following requirement:
-
To block
/api/assetswhen it isn’t required externally:- Add a deny rule for
/api/assetsin your Dispatcher filter configuration after your allow rules. - Use a deny-by-default allowlist model in Dispatcher for stronger security.
- Add a deny rule for
-
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.
-
Deploy configuration changes according to your environment’s deployment process.
-
Test in a non-production environment before deploying to production. Flush the Dispatcher cache and verify that anonymous requests to
/api/assetsare either blocked or require authentication (returning 401/403errors as appropriate).