Mosaic is a visual layout builder for Drupal 11/12 that enables content authors to compose pages from reusable components without writing code. It uses a canvas-based editor (Puck + React 19) with PHP 8 Attribute-based component plugins, a design token entity type with CSS custom property export, schema versioning with queue-based migration, and built-in WCAG 2.2 AA accessibility. Fully self-hosted with no cloud dependency.
It differs from Drupal core Layout Builder by providing a full drag-and-drop canvas with live data binding from entity fields, Views, REST, and context sources.
Security measures:
- All POST routes require _csrf_request_header_token: TRUE
- All content entity queries use accessCheck(TRUE)
- accessCheck(FALSE) only for config entity CSS on anonymous pages (documented)
- No dynamic SQL — all queries via Drupal entity query API
- Input sanitised via Twig auto-escaping throughout
- Route access via mosaic.administer permission
- SSRF protection on all outbound URL resolution
Code quality:
- PHPCS Drupal + DrupalPractice: 0 errors, 0 warnings
- PHPUnit: 935 tests passing (Unit + Kernel + Functional)
- PHP 8.1+ compatible, no deprecations
- Drupal ^11.1 || ^12 supported
I will complete the review bonus (3 reviews) and post links here before this issue is closed.
Comments
Comment #2
arunkarthick commentedComment #3
vishal.kadamComment #4
avpadernoThank you for applying!
Before giving links helpful to understand how the review process works, what to expect from a review, and what to do to avoid a review takes more time than needed, I would like to thank all the reviewers for the work they do.
These applications are volunters-driven, which also means it is not possible to predict when an application will be marked fixed and the applicant will get the permission to opt projects into security advisory policy. While we aim to make an application as quick as possible, it is also important for us that more people review the project used for an application. In this way, we make sure applications do not miss some important points that should be instead reported.
Applications are not meant to be complete debugging sessions that eliminate every existing bug, though. I apologize if sometimes applications seem to go into too-detailed reviews.
Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.
The important notes are the following.
Keep in mind that once the project is opted into security advisory coverage, only Security Team members may change coverage.
To the reviewers
Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.
The important notes are the following.
For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.
Comment #5
vishal.kadam1. FILE: mosaic.libraries.yml
version: VERSIONVERSION is only used by Drupal core modules. Contributed modules should use a literal string that does not change with the Drupal core version a site is using.
2. FILE: mosaic.module and modules/mosaic_canvas_bridge/mosaic_canvas_bridge.module
A new module that aims to be compatible with latest Drupal releases is expected to implement hooks as class methods as described in Support for object oriented hook implementations using autowired services.
Comment #6
arunkarthick commentedFixed in 1.0.0-rc3.
Thank you for the review @vishal.kadam. Both issues have been addressed:
**1. version: VERSION in mosaic.libraries.yml**
Removed from all four library definitions (renderer, device_preview,
media_library_bridge, builder). VERSION resolves to the Drupal core
version, not the module version. Drupal.org packaging rewrites .info.yml
files but not .libraries.yml files.
**2. Procedural hooks → OO #[Hook] attribute pattern**
All procedural hook functions have been migrated:
- src/Hook/MosaicHooks.php — hook_help, hook_page_attachments,
hook_mosaic_global_template_presave, hook_runtime_requirements
- modules/mosaic_canvas_bridge/src/Hook/MosaicCanvasBridgeHooks.php —
hook_field_formatter_info_alter, hook_entity_view_alter
(both with Order::Last)
hook_module_implements_alter was deleted rather than converted — it is
removed in Drupal 12 and cannot be a #[Hook] class method. The run-last
ordering it provided is replaced by Order::Last on the actual hook
methods. The module is now fully Drupal 12 compatible.
Comment #7
vishal.kadamIt is better not to create new releases during these applications, since a review could ask for a change that is not backward compatible with the existing releases. Just using a development version avoids those BC issues.
Comment #8
vishal.kadamRest seems fine to me.
Please wait for other reviewers and Project Moderator to take a look and if everything goes fine, you will get the role.
Comment #9
avpadernosrc/Hook/MosaicHooks.php
Any dependency must be injected using the dependency injection container, except in the case the dependency is used only from static methods.
Hook classes are essentially autowired service classes that do not need to be defined in the .services.yml file. As such, any dependency is defined as parameter of the class constructor.
It is also better to initialize the string translation instance calling
setStringTranslation().Is the label a translatable string?
As per Drupal coding standards, only a white space is required before and after the assignment operator and other operators.
LICENSE.txt
The content of the LICENSE.txt file is expected to be the same of the LICENSE.txt file used by Drupal core.
modules/mosaic_acsf/mosaic_acsf.module
Drupal core no longer requires a .module file to recognize a module. If those files do not contain code, they can be omissed.
src/Controller/AiGenerateController.php
A controller class is not supposed to be extended by classes implemented by other modules, so it is fine to use private property. It would also be better to define the class final.
Strings shown in the user interface must be translatable.
src/Controller/ComponentPackagesController.php
Since that class does not use methods from the parent class, or it uses a single method from the parent class, it does not need to use
ControllerBaseas parent class.Controllers do not need to have a parent class; as long as they implement
\Drupal\Core\DependencyInjection\ContainerInjectionInterface, they are fine.For translatable strings that change basing on a number (as in this case), there is
::formatPlural().src/Controller/EntityFieldsController.php
A controller class needs to implement
\Drupal\Core\DependencyInjection\ContainerInjectionInterface.Since its properties are private, the class can be as well final.
Comment #10
arunkarthick commentedThank you for the detailed review, @avpaderno. All 9 issues from Comment #9 have been addressed. Here is a summary of each fix:
1. MosaicHooks — Remove \Drupal:: static calls
All static calls replaced with constructor-injected services:
AccountProxyInterface,MosaicTokenManager,MosaicTokenBridgeService,StateInterface,TimeInterface, andTranslationInterface(passed tosetStringTranslation()).2. MosaicHooks — Register as DI service
Registered in
mosaic.services.ymlwith the FQCN as the service ID (Drupal\mosaic\Hook\MosaicHooks:). Note: using a custom service ID causesHookCollectorPass::registerHookServices()to create a second autowired definition with zero constructor arguments, resulting inArgumentCountErrorat runtime. FQCN is required.3. AiGenerateController — Add
finalkeywordClass is now declared
final.4. AiGenerateController — Add
StringTranslationTrait+ wrap error strings int()StringTranslationTraitadded,TranslationInterfaceinjected. All three error response strings (Rate limit exceeded. Try again later., Invalid JSON payload., No components available for generation.) are now wrapped in$this->t().5. ComponentPackagesController — Drop
extends ControllerBaseReplaced with
implements ContainerInjectionInterface+use StringTranslationTrait.TranslationInterfaceinjected directly.6. ComponentPackagesController — Use
formatPlural()for component count@count componentsint()replaced with:$this->formatPlural(count($components), '1 component', '@count components')7. EntityFieldsController — Add
implements ContainerInjectionInterfaceInterface was missing despite
create()being present. Added.8. EntityFieldsController — Add
finalkeywordClass is now declared
final.9. mosaic_acsf.module — Delete empty file
File contained only a
@filedocblock anddeclare(strict_types=1). Deleted. Drupal 11 does not require a.modulefile for module recognition, and the ACSF factory hooks are invoked directly by ACSF without it.Commits:
c996ae2— All 9 avpaderno fixesef04a7e— Follow-up: FQCN service ID for MosaicHooks (caught by Kernel tests during QA)On the release strategy:
A
1.0.x-devrelease has been created and is now live at https://www.drupal.org/project/mosaic/releases. This tracks the1.0.xbranch tip and will automatically reflect all further fixes as they are pushed — no separate release node is needed for each update.The stable
1.0.0tag will be cut once this security advisory application is approved. This avoids the overhead of repeated release candidate tags while the review is in progress, and ensures the published stable release is clean from the start.Please let me know if any further changes are needed. Thank you again for the thorough review.
Comment #11
avpadernoThank you for your contribution and for your patience with the review process!
I am going to update your account so you can opt into security advisory coverage any project you create, including the projects you already created.
These are some recommended readings to help you with maintainership:
You can find more contributors chatting on Slack or IRC in #drupal-contribute. So, come hang out and stay involved!
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
I thank also all the reviewers for helping with these applications.
Comment #12
avpadernoComment #14
arunkarthick commentedThank you so much, Avpaderno — and thank you for the thorough and detailed review.
The feedback through this process has genuinely made the module better, and I
appreciate both your time and your patience.
I have tried to opt into security advisory coverage on the project edit page, but
the "Opt into security advisory coverage" option is currently not enabled for
selection. Could you confirm once the account update has been applied? I will
check back and enable it as soon as it becomes available.
Thank you again for everything.
Comment #15
vishal.kadamNew projects must wait 10 days before opting in.
Comment #16
avpadernoThe description for the Security advisory coverage field says New projects must wait 10 days before opting into security advisory coverage. Please take this time to review writing secure code and best practices. The project has been created on May 10; that means waiting until May 20/21.