SA-CONTRIB-2026-332: Critical severity composer/drupal/smart_trim vulnerability

Published Nov 11, 2026
·
Updated

This module implements a field formatter for text fields that improves the Summary or Trimmed formatter built into Drupal core. The module doesn't sufficiently escape unsafe HTML when passed through the module's Twig filter. This vulnerability is mitigated by the fact that an attacker must have a role with the ability to post content that gets passed through a Twig template with one of the |smarttrim filters provided by this module. If a site uses only use the field formatter without the Twig filter, it is not vulnerable.

Credit

Pierre Rudloff (prudloff)(the Drupal Security Team)

Affected Software

1 affected componentFixes available
composer/drupal/smart_trim<2.3.2, <2.2.2
2.3.22.2.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/drupal/smart_trim to a version that resolves this vulnerability.

    Fixed in 2.3.2Fixed in 2.2.2
  2. Configuration

    Use only the module's field formatter and do not use the module's Twig filters (|smart_trim_*).

    This module Twig filters = disabled

Event History

Nov 11, 2026
Advisory Published
via Drupal·12:00 AM
Data Sourced
via Drupal·12:00 AM
DescriptionSeverityAffected Software

Child vulnerabilities

Contains the following vulnerabilities.

Frequently Asked Questions

1

Who is exposed to this issue?

Sites are exposed only when content from a user who can post content is passed through a Twig template using one of the module's |smart_trim_* filters. An attacker must hold a role permitted to submit that content.

2

Is a site affected if it uses Smart Trim only as a field formatter?

No. The issue does not affect sites that use only the module's field formatter and do not use its Twig |smart_trim_* filters.

3

What configuration should be reviewed during triage?

Review Twig templates for use of |smart_trim_* filters and determine whether user-submitted content can reach those filters. Also review which roles can post the relevant content.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203