Skip to content
EnglishFrançais

Platforms / Drupal

Drupal security scan

A Drupal security scan is the CMS Security Audit of the custom modules, themes and configuration that a site owner adds on top of Drupal core.

The CMS Security Scanner reads the custom code of a Drupal 7, 8, 9, 10 or 11 site, including Drupal CMS, self-hosted or on Acquia Cloud Platform. Each finding names the module, the file and the line, and a CMS Security Consultant checks it before the report.

Request a scanSee a sample report

Versions

Drupal 7, 8, 9, 10 and 11, including Drupal CMS, self-hosted or on Acquia Cloud Platform

Code read

PHP, Twig, YAML and JavaScript in custom modules and themes

What we need

Custom modules and themes, composer.lock, exported configuration and settings files with secret values removed

Report

One finding per issue, with its entry point, its severity and a fix for your developers

How Drupal receives a request

  • Drupal runs on the Symfony HTTP kernel, and a module declares its routes in a routing.yml file with access requirements.
  • Services, event subscribers and access checkers are declared in a services.yml file and built into a Symfony container.
  • Blocks, field formatters, REST resources and queue workers are plugins that Drupal finds through PHP attributes or annotations.
  • Hooks let a module change forms, entities and access decisions of core and of other modules.
  • Code returns render arrays that Drupal renders through Twig templates, with cache contexts that decide who sees which output.

Entry points reviewed

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

CategoryConstruct in your codeRisk
Routes and controllersRoutes in *.routing.yml, route callbacks, RouteSubscriber classes and hook_menu() items in Drupal 7A route with a weak access requirement or a missing _csrf_token exposes its controller.
Forms and AJAXForm API classes, hook_form_alter() and #ajax callbacksForms take user input, and an alteration can remove a validation step or change #access.
Web servicesREST resource plugins, JSON:API settings, custom normalizers and denormalizersWeb services are direct HTTP entry points that turn client data into field values.
GraphQLSchema extensions, data producers and resolvers of the graphql moduleEach resolver must check entity access itself before it returns data.
Display pluginsBlock plugins, field formatters and field widgetsThese plugins output stored values, so they are a common place for stored XSS.
Entity and access hookshook_entity_*, hook_node_access(), hook_node_grants() and hook_query_TAG_alter()An access hook that grants too much affects every page and listing that shows the entity.
Access and authentication servicesAccess checkers, _custom_access callbacks, authentication providers, SSO and OAuth codeThese services decide who the user is and whether the user reaches a route.
Request pipelineEvent subscribers on kernel events, HTTP middleware and parameter convertersCode that runs before routing and access checks can bypass both.
Background jobs and commandsQueue workers, hook_cron(), Drush commands, install and update hooksBackground code runs with full privileges on data that users stored earlier.
Views extensionsCustom views fields, filters, arguments and hook_views_query_alter()A custom handler can add raw SQL or skip the access tag of the view query.
Webhooks and file uploadsInbound integration controllers, managed_file elements and upload validatorsA webhook must verify its sender, and an upload handler decides file names and destinations.
Templates and front endTwig templates, preprocess hooks, Drupal behaviors and Canvas code componentsTemplates and client code decide which output Twig escapes and which output reaches the DOM unescaped.
Configuration as codeExported roles, permissions, text formats and links in config/sync and *.links.*.ymlA permission granted to the anonymous role or an unsafe text format changes the attack surface.

Dangerous operations traced

The scan traces user data from each entry point to the operations below.

OperationWhat the scanner looks for
SQL injectionQueries built by concatenation, and user data in condition(), orderBy() or expressions instead of placeholders.
Access bypassEntity queries with accessCheck(FALSE), entity loads without an access check and routes open to everyone.
Cross-site scriptingUser data in #markup, Markup::create(), the Twig raw filter or the wrong Xss filter.
Cross-site request forgeryGET routes that change data without a _csrf_token requirement, and forms without a form token.
Server-side request forgeryThe http_client service, Guzzle and URL reads where a user controls the destination host.
Deserializationunserialize() on request, cookie, cache or database data without an allowed_classes option.
Files and pathsUser-chosen stream wrappers, paths built from request data, wide upload extension lists and private files served without access checks.
Code and command executioneval(), dynamic callables, render array callbacks set from data and shell commands that take user input.
Open redirect and cache leaksTrustedRedirectResponse to user-chosen hosts, and personal output without the user or permissions cache context.
SecretsCredentials, API keys and the hash salt in settings.php, configuration YAML or module code.

Dependencies and configuration checked

  • Drupal core version and whether its branch still receives security fixes
  • Symfony components, Twig and Guzzle as locked in composer.lock
  • Contributed modules such as webform, graphql, simple_oauth, samlauth, openid_connect and the ai modules of Drupal CMS
  • Third-party libraries such as pear/archive_tar and front-end packages that themes ship
  • Each locked package compared with Drupal SA-CORE and SA-CONTRIB advisories and public vulnerability databases
  • Permissions of the anonymous and authenticated roles in exported configuration
  • Text formats, and which roles can use a format that allows raw HTML
  • REST and JSON:API settings, including JSON:API write access
  • Trusted host patterns, reverse proxy settings and the private file path in settings.php
  • Exposure of update.php, install.php, rebuild.php and development modules on production
  • How settings files load secrets on hosting such as Acquia, and which deployment hooks run Drush

Typical findings

Drupal security advisories show the vulnerability classes that the scan looks for in custom code.

  • SQL injection in database queries, the class of SA-CORE-2014-005
  • Remote code execution through render arrays and forms, the class of SA-CORE-2018-002
  • Remote code execution through web services, the class of SA-CORE-2019-003
  • PHP object injection and gadget chains, such as SA-CORE-2026-005 and SA-CORE-2025-006
  • Arbitrary code execution through uploaded files and archives, such as SA-CORE-2022-014
  • Server-side request forgery, such as SA-CORE-2026-008
  • Access bypass, such as SA-CORE-2025-002
  • Cross-site scripting, such as SA-CORE-2025-001

Frequently asked questions about Drupal

Which parts of a Drupal site are in scope?

The scanner reviews the custom modules, custom themes, patches and exported configuration of a Drupal 7, 8, 9, 10 or 11 site. It lists every entry point, such as routes, forms, REST resources, hooks and queue workers. It then traces user data from each entry point to dangerous operations such as SQL queries, output and file writes.

Does the scan cover Drupal core and contributed modules?

The scan does not audit Drupal core or contributed modules as products, because the Drupal Security Team publishes advisories for them. The scan checks the versions in composer.lock against those advisories. It also checks whether your custom code calls a vulnerable function in a dependency.

Why is custom Drupal code a security risk when core is secure?

Drupal core gives safe APIs, but custom code can skip them. Examples are a query built by string concatenation, an entity query with accessCheck(FALSE) or a Twig template with the raw filter. Drupal advisories cover core and contributed modules, and no advisory covers the custom code of one site.

Does the scan need access to the production site?

The scan needs the source code, composer.lock, exported configuration and settings files with secret values removed. It does not need production access, a database dump or user content.

Do you scan Drupal sites hosted on Acquia?

Yes. Acquia Cloud Platform runs standard Drupal, so the scan reads the same custom modules, themes and configuration. The report also covers the Acquia-specific settings files that your repository holds.

What happens when Drupal 10 reaches end of life?

Drupal 10 reaches end of life on 9 December 2026, and after that date it gets no security fixes. A site that stays on Drupal 10 carries the risk of every later core advisory. The report states the core branch of your site and its support status.

Other platforms

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

Request a Drupal security scan

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