DRUPAL-CONTRIB-2026-332: Composer/drupal/smart_trim vulnerability
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
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
composer/drupal/smart_trimto a version that resolves this vulnerability.Fixed in 2.2.2 - Upgrade
Upgrade
composer/drupal/smart_trimto a version that resolves this vulnerability.Fixed in 2.3.2 - Configuration
Use only the field formatter and do not pass content through any of the module's |smart_trim_* Twig filters.
Drupal module's Twig templates smart_trim_* Twig filters = not used