Skip to main content
Blue Moose logo Blue Moose Field notes
← All articles
drupal

Four Drupal XSS fixes, one repeated escaping gap

Laptop with code on screen in a dark room

On November 11 the Drupal Security Team published eight contrib advisories in one batch, and four of them are cross-site scripting. Read separately they are small, moderately critical, "theoretical" exploitability. Read together they show the same mistake four times: escaping done on one path and forgotten on the sibling path. I went through the primary advisories to see what each one actually needs from an attacker.

Smart Trim: the Twig filter wasn't the formatter

SA-CONTRIB-2026-332 (CVE-2026-126741) affects Smart Trim below 2.2.2, and 2.3.0 up to but not including 2.3.2. The field formatter extends core's Summary or Trimmed formatter, but the module's Twig filters did not sufficiently escape unsafe HTML. The advisory is explicit that sites using only the field formatter, without a |smart_trim_* filter, are not vulnerable. The attacker needs a role that can post content that reaches such a filter. Fix: 2.3.2 or 2.2.2.

That detail matters. A "do I use this module" check isn't enough; you need to grep your templates:

grep -rn "smart_trim" web/themes web/modules/custom --include=*.twig

Datafield: stored values echoed as labels

SA-CONTRIB-2026-339 (CVE-2026-126760) is in Data field, fixed in 3.0.1 and 2.0.15. The autocomplete endpoint returned stored field values as suggestion labels without escaping them sufficiently. Exploitation requires permission to edit an entity carrying a Data Field field, and the field must use the "Search - autocomplete" widget. So it is stored XSS gated behind a specific widget choice, which is why the score is only 12/25.

Two incomplete earlier fixes

The other two are the ones I find most instructive, because both are follow-ups to earlier patches.

SA-CONTRIB-2026-335 (CVE-2026-126744) hits Layout Builder iFrame Modal before 1.3.9. The module has a custom Ajax command that opens a dialog, and it did not sanitize dialog options the way core has since SA-CORE-2026-001. The advisory says the module fix depends on that core fix, so you also need core 10.5.9, 10.6.7, 11.2.11, 11.3.7 or later. If you ship your own Ajax commands, this is the lesson: when core hardens a built-in command, your copy of the pattern doesn't inherit it.

SA-CONTRIB-2026-334 hits COOKiES Consent Management before 1.2.17. The module converts data-cookies-video-blazy-src into a src attribute for Blazy iframes without validating it. A protocol check added in SA-CONTRIB-2025-092 covered the other conversion paths but missed this one. It needs an administrator with broad permissions and a specific element and class, so it is the hardest of the four to reach. No CVE is listed on the page.

What I'd actually do

  • Run composer outdated "drupal/*" or drush pm:security and bump the four modules if you have them.
  • For Smart Trim, search templates for the filter rather than trusting the module list.
  • For Layout Builder iFrame Modal, check your core version first; the module patch alone isn't the whole fix.

None of these will make headlines next to the core RCE from the same week. But the pattern is the point: when I review a custom module, I now look for the second route to the same sink, the formatter next to the filter, the autocomplete next to the widget, the one converted attribute next to the four checked ones. That is where patches tend to leave a gap.

BM
Blue Moose
The moose behind Blue Moose. Full-stack PHP developer — Drupal by day, Symfony by night, tests always.