CVE-2026-126741: 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.

Affected Software

2 affected componentsFixes available
composer/drupal/smart_trim<2.2.2
2.2.2
composer/drupal/smart_trim>=2.3.0<2.3.2
2.3.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.2.2
  2. Upgrade

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

    Fixed in 2.3.2
  3. Compensating control

    Restrict roles from posting content that is passed through a Twig template using one of the module's |smart_trim_* filters.

Event History

Nov 11, 2026
Advisory Published
via OSV·06:00 PM
Data Sourced
via OSV·06:00 PM
DescriptionAffected Software

Frequently Asked Questions

1

Which sites are exposed to this issue?

A site is exposed only if untrusted content can be posted by a user whose content is later rendered through a Twig template using one of the module's |smart_trim_* filters. Sites that use only the field formatter are not vulnerable.

2

What level of attacker access is required?

An attacker needs a role that can post content which is passed through a Twig template using a |smart_trim_* filter. The provided information does not indicate that unauthenticated access alone is sufficient.

3

How can I determine whether my site is affected?

Review Twig templates for use of the module's |smart_trim_* filters and determine whether content posted by roles with content-creation permissions can reach those filters. If the module is used only as a field formatter and its Twig filters are not used, the site is not vulnerable.

4

What can be done if patching cannot happen immediately?

Avoid passing user-posted or otherwise untrusted content through Twig templates that use the module's |smart_trim_* filters. Using only the field formatter does not trigger this vulnerability.

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