Skip to content
EnglishFrançais

Platforms / AEM

AEM security scan

An AEM security scan is the CMS Security Audit of the custom Java bundles, HTL scripts, configuration and Dispatcher rules of an Adobe Experience Manager project.

The CMS Security Scanner reads the custom code of an AEM project on AEM 6.2 to 6.5, on premises or on Adobe Managed Services, or on AEM as a Cloud Service. A CMS Security Consultant checks each finding in your bundles and Dispatcher rules before it goes into the report.

Request a scanSee a sample report

Versions

AEM 6.2 to 6.5, on premises or on Adobe Managed Services, and AEM as a Cloud Service

Code read

Java bundles, HTL and JSP scripts, clientlibs, OSGi configurations, content packages, ACLs and repoinit, Dispatcher and CDN configuration

What we need

A source archive or a Git repository, the AEM version, and the Dispatcher and CDN configuration

Report

Findings with severity, the entry point, the code path to the sink and a fix, reviewed by CMS Security Consultants

How AEM receives a request

  • AEM runs custom Java code as OSGi bundles on Apache Felix, in the same runtime as the product.
  • Apache Sling maps each request to a resource in the JCR repository, which Apache Jackrabbit Oak stores with its access control lists.
  • The resource type, the selectors, the extension and the HTTP method decide which servlet or HTL script handles the request.
  • Authors edit content on the author tier, and replication copies the published content to the publish tier that serves visitors.
  • The Dispatcher filters and caches requests in front of publish, and AEM as a Cloud Service adds an Adobe-managed CDN that the customer configures.

Entry points reviewed

The scan lists every construct that lets a request, an event or a job reach custom code, and records the access control in front of it.

CategoryConstruct in your codeRisk
Path-bound servletssling.servlet.paths, @SlingServletPaths and the older @SlingServlet annotationRepository ACLs cannot protect a path-bound servlet, so the code and the Dispatcher filter are its only gates.
Resource-type servletssling.servlet.resourceTypes with selectors, extensions and methodsAny resource that carries the resource type reaches the servlet, so a broad binding widens the reachable surface.
Filters, whiteboard servlets and authentication handlersSling filters, OSGi HTTP Whiteboard servlets, AuthenticationHandler implementations for SAML, OAuth and custom tokensA filter sees every request in its scope, and an authentication handler decides what proof of identity the platform accepts.
Sling Models and JSON exporters@Model classes, Java Use objects, @Exporter with the Jackson exporterEach exported model becomes a JSON endpoint on every resource that it adapts, without a servlet declaration.
HTL and JSP componentsComponent scripts under /apps and overlays of product scripts under /libsEach script is an implicit entry point that Sling selects by resource type, and an overlay inherits the product traffic.
Sling POST servlet and custom POST operations:operation requests, PostOperation and SlingPostProcessor servicesThe POST servlet is a write API on every resource, and the repository ACLs are its only gate.
Resource providers, adapters and rewritersResourceProvider, AdapterFactory, rewriter TransformerFactory and SitemapGenerator servicesThese components create synthetic resources or process every served page, often for anonymous visitors.
Headless and query APIsAEM GraphQL endpoints, persisted queries, Content Fragment models and Query Builder predicatesA GraphQL endpoint exposes the content models of its configuration, and request data in a predicate changes the repository query.
Workflows, events, jobs and schedulersWorkflowProcess steps, workflow launchers, EventHandler, JobConsumer, ResourceChangeListener and Sling Scheduler jobsA content change can start background code that runs as a service user with more rights than the author.
Replication and distributionReplication agents, Sling Content Distribution and Replicator callsThese paths move content from the author tier to the publish tier, where visitors see it.
OSGi configuration, ACLs and service usersRun-mode OSGi configurations, _rep_policy.xml files, repoinit scripts, service user mappings and closed user groupsThese files decide who may read or write each path and what each service identity may do.
Resource mapping and content packages/etc/map, vanity paths, aliases, redirect properties, the Externalizer, filter.xml and install hooksMapping rules decide which hosts and links the site trusts, and install hooks run code at deployment time.
Dispatcher and CDN rulesDispatcher farms, filters, cache rules, virtual hosts, rewrite rules and cdn.yaml traffic filtersThese rules decide which paths, selectors and methods reach publish, and which responses other visitors receive from cache.
Client libraries and authored markupClientlib JavaScript, inline scripts and data attributes in HTL, DAM SVG and HTML assets, Experience Fragments and i18n dictionariesData that the server escapes for one context can reach a DOM sink in the browser of every visitor.

Dangerous operations traced

The scan traces user data from each entry point to the operations below, in the source code and in the compiled bundles.

OperationWhat the scanner looks for
Repository query injectionQueryBuilder predicates, JCR-SQL2 and XPath strings built from request data instead of fixed or bound values.
Privileged sessionsService resource resolvers and the deprecated administrative resolver, and the request data that reaches code after the elevation.
Repository writes and permission changesNode, property and DAM asset writes, ACL changes and replication calls that a lower-privileged caller can steer.
Cross-site scriptingHTL expressions with context='unsafe' or a weak explicit context, raw response writers in Java, and DOM sinks in clientlibs.
Server-side request forgeryOutbound HTTP clients and URL connections whose target host or path comes from request data or authored content.
DeserializationJackson polymorphic typing, Java object streams, XMLDecoder, YAML and XStream binding of untrusted data.
XML external entitiesXML parsers and transformers that resolve external entities or schemas from request data.
Path traversal and file accessFile system reads and repository path lookups whose path comes from a suffix, a selector or a request parameter.
Command and code executionProcess execution, script engines, Groovy evaluation and reflection that request data can reach.
Open redirect and injection in mail or logsRedirect targets, mapped links, mail headers and log lines built from request data without validation.

Dependencies and configuration checked

  • A software bill of materials of the source tree and of the built bundles, matched offline against known vulnerabilities
  • Libraries that a bundle embeds or shades, such as Jackson, Apache Commons, Guava, Gson, Apache HttpClient and XML libraries
  • A reachability check that tells whether custom code calls the vulnerable part of each dependency
  • Third-party JavaScript inside clientlibs and the front-end build, identified by banner, file name or hash
  • The AEM API dependency, aem-sdk-api on AEM as a Cloud Service or uber-jar on AEM 6.x, which shows the targeted product release
  • The build chain in pom.xml, settings.xml and package-lock.json, and the Dispatcher module version
  • OSGi configurations against the product defaults per run mode, such as CORS, the Referrer filter and Sling authentication requirements
  • Secrets in OSGi configurations and content, recorded by property name and never by value
  • Repository ACLs, repoinit scripts, service user mappings and closed user groups
  • Dispatcher filters, cache rules and virtual host headers against the Adobe default files
  • The cdn.yaml traffic filters, WAF flags, rate limits and redirects on AEM as a Cloud Service
  • Resource mapping, vanity paths and the Externalizer configuration

Typical findings

Adobe security bulletins for AEM show the vulnerability classes that the scan looks for in custom code.

  • Stored, reflected and DOM-based cross-site scripting, the largest category in bulletins such as APSB24-21, APSB25-48 and APSB26-74
  • Improper input validation and security feature bypass, as in APSB25-90
  • XML external entity processing, as in APSB25-90 and APSB26-74
  • Server-side request forgery, as in APSB26-74
  • Missing authentication for a critical function, as in APSB26-74
  • Path traversal, as in APSB26-74
  • Authorization gaps between Dispatcher filters and repository ACLs
  • Secrets stored in OSGi configuration and repository content

Frequently asked questions about AEM

What does the scan read in an AEM project?

The scanner reviews the custom code and configuration that a customer deploys on AEM, not the Adobe product. This includes Java bundles, HTL and JSP scripts, clientlibs, OSGi configurations, ACLs, Dispatcher rules and the CDN configuration. CMS Security Consultants review each finding before the report.

Which AEM versions does the scan cover?

The scan covers AEM 6.2 to 6.5, on premises or on Adobe Managed Services, and AEM as a Cloud Service. The version decides who owns the product updates, so the report separates custom code issues from product patch levels.

Is a path-bound Sling servlet a security problem?

A path-bound servlet is not a defect by itself. Repository ACLs cannot protect a path-bound servlet, so the code and the Dispatcher filter must enforce access. The Apache Sling documentation recommends resource-type binding for this reason.

Why does the scan read the Dispatcher and CDN configuration?

The Dispatcher and the CDN decide which requests reach the publish tier and which responses they cache. A permissive filter or cache rule can expose a servlet or serve one visitor's response to other visitors.

Does Cloud Manager code quality replace this scan?

Cloud Manager runs SonarQube and OakPAL rules on every build, and those rules check code patterns file by file. The scan follows data from each entry point to each sink, and it also reads ACLs, Dispatcher rules and the built bundles.

Does the scan send requests to my AEM environments?

No. The scan reads source code, configuration and built artifacts. It needs no credentials for an author or publish environment.

Other platforms

The same method, report and consultants apply to each platform.

Request an AEM security scan

Tell us how to reach you. A CMS Security Consultant will contact you to plan your AEM scan.