Drupal security updates, in plain English · Module

Custom Formatters

3,157 sites report using it · on drupal.org · 1 security update explained here

This module allows users to easily create custom field formatters through an admin interface without writing a custom module.

Below is every security update for Custom Formatters that this site has covered, newest first. Each one says who could exploit it, whether it applies to your site, how urgent it is, and what to tell your developer. If your site uses this module and you are not sure which version, that is the first question to ask whoever looks after it.

Custom Formatters

Critical · 3,157 sites report using it · SA-CONTRIB-2026-225 · on drupal.org · Week of 21 October 2026

The formatter engine runs a function to execute user provided PHP code and allows arbitrary PHP execution on the site. An administrator account could view any private data on the site and alter any data on the site, including the underlying code.

  • Who could do thisOnly someone with an administrator login.
  • Does it apply to youAny site using this module.
  • Has it been used in attacksNo sign of it.
  • How urgentDrupal rates this critical. Cyber Essentials expects a fix within 14 days. Do it this week.

Tell your developerUpdate Custom Formatters to 4.2.1.

For developers: what the fix changed

The fix introduces granular permissions for custom formatters, adding restricted permissions for creating and editing PHP and Twig formatters in custom_formatters.permissions.yml and enforcing them via FormatterAccessControlHandler.php. It also updates the routing requirements and plugin definitions to use these new permissions.

Also in this release The release branch was updated to 4.2.x in CI and documentation files, and the changelog was updated.

4.2.0 to 4.2.1 2 commits, 12 files.

  • CHANGELOG.md +28 −0
  • README.md +8 −5
  • codecov.yml +1 −1
  • custom_formatters.module +2 −2 fix
  • custom_formatters.permissions.yml +29 −1 fix
  • custom_formatters.routing.yml +3 −3 fix
  • src/Annotation/FormatterType.php +13 −0 fix
  • src/Attribute/FormatterType.php +7 −0 fix
  • src/Controller/CustomFormattersController.php +8 −3 fix
  • src/FormatterAccessControlHandler.php +92 −3 fix
  • src/Plugin/CustomFormatters/FormatterType/Php.php +7 −5 fix
  • src/Plugin/CustomFormatters/FormatterType/Twig.php +9 −0 fix

Full diff, 4.2.0 to 4.2.1

The comparison is against the release immediately before the fix. If your site is on an older release, more will have changed.

Not sure what your site is running?

Send me your Drupal site's address.

I'll tell you what I can see from outside, what the Drupal 10 end of life on 9 December means for it, and what it would cost to have me keep it patched. There's no charge for that and no obligation. peter@peterbrady.co.uk


Get in touch

Tell me who you are, what your organisation does, and what you need. That might be a Drupal site that needs looking after, an upgrade to get done before December, or an agency that needs Drupal cover.

If I can help, I'll say so and suggest a call. If I can't, I'll tell you straight away rather than waste your time.

peter@peterbrady.co.uk

For context: I work mainly with UK membership bodies, charities and research organisations, and with the agencies that look after their websites. Not recruiters.

Or start smaller and connect with me on LinkedIn. That's where I post what I find digging around in charity and grants data, and where the free tools turn up first.