- Package
- drupal/smart_trim
- Fixed in
- 2.2.2, 2.3.2
- Published
- Wed 11 Nov 2026, 18:00 Lisbon
In plain words
The Smart Trim module does not sufficiently escape unsafe HTML passed through its Twig filters. An attacker must have a role that allows them to post content which is then passed through a Twig template using one of the module's |smart_trim_* filters. Sites using only the field formatter, without the Twig filter, are not vulnerable.
How serious is it?
The source record has no severity score, so the rating is yours to make. Read the description for two things: what an attacker needs (an account, a particular setting, a user who clicks a link) and what they get. Drupal security advisories carry their own risk score on drupal.org, which is not in the OSV record. When the advisory gives no details at all, assume the worst until you know more: an unfixed issue with an unknown impact is not a low one.
Am I affected?
Look for drupal/smart_trim and its version in composer.lock. The advisory lists fixes in 2.2.2 and 2.3.2, but gives no affected version range. Check whether Twig templates use any |smart_trim_* filters and whether a role can post content that reaches those filters. Using only the field formatter does not expose this flaw.
Did you install drupal/smart_trim, or did a dependency?
Composer says why a package is in your project:
composer why drupal/smart_trim
If the output names your own project, you required drupal/smart_trim directly and the update is yours to make. If it names another package, drupal/smart_trim came in through it, and that package's version constraint decides which release you can install. To see what stands between you and the fix, ask Composer directly:
composer why-not drupal/smart_trim 2.2.2
Every line it prints is a constraint that blocks 2.2.2. Update the package it names, or raise your own constraint, and run it again until it prints nothing. If you stay on an older branch, ask about its fix instead: 2.3.2.
What to do
Check which version you have, then update to a fixed release for your branch (2.2.2, 2.3.2):
composer show drupal/smart_trim | grep versions
composer update drupal/smart_trim
If your version constraint in composer.json keeps you below a fixed release, raise it first. Whether your configuration is affected, and the exact version ranges, are in the advisory itself.
If you cannot update yet
Use only the field formatter without the Twig filter.
Check the whole project at once
Composer 2.4 and later can list every installed package with a known advisory, this one included once Packagist has it:
composer audit --locked
--locked reads composer.lock instead of the vendor folder, so you can run it on a release tag or in CI without installing anything. It exits with a non-zero code when it finds an advisory, which is enough to fail a build. Run it on every branch you still support, not only the newest: an older release your customers run is affected in the same way.
Under the Cyber Resilience Act
No exploitation of this vulnerability is known, so on its own it does not start the Article 14 reporting clock, which covers actively exploited vulnerabilities. That changes if you learn it is being exploited through your product: then the 24-hour early warning applies.
Either way, if drupal/smart_trim ships inside a product you sell, the CRA treats its vulnerabilities as yours. Article 13(5) asks for due diligence on the components you include, and from 11 December 2027 Annex I asks you to ship security fixes without delay and free of charge for the support period you declared. A short note in your changelog saying which release updated drupal/smart_trim, and why, is the evidence you will want later.
What goes in each Article 14 report · Does the CRA apply to your product?
drupal/smart_trim's record
This is the only advisory for drupal/smart_trim since the digest started following Composer packages in September 2026. One advisory says little about a package's quality; what matters is how fast the fix came, and here it is out.
The advisory's description
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 |smart_trim_* filters provided by this module.
If a site uses only use the field formatter without the Twig filter, it is not vulnerable.
The advisory
- OSV.dev: DRUPAL-CONTRIB-2026-332
- The week's digest, with the other advisories from 9 Nov 2026
- All advisories for drupal/smart_trim