Drupal's Highlight.js module: critical XSS
Most of the Drupal advisories I read are about modules that handle data: uploads, access checks, payment callbacks. SA-CONTRIB-2026-299 is about a module that only makes code snippets look pretty, and it still landed in the "Critical" bucket. If you have ever pasted a PHP snippet into a CKEditor 5 field and wondered how it got coloured, this one is worth two minutes.
What the advisory says
The affected project is Highlight.js syntax highlighter (machine name highlight_js). It adds syntax-highlighted code blocks to content through CKEditor 5. Per the advisory, published 4 November 2026, its CKEditor 5 preview endpoint does not sufficiently validate input, which allows a reflected cross-site scripting attack. It is tracked as CVE-2026-122068.
- Affected: all releases before 1.3.1
- Fixed in: 1.3.1
- Risk score: 16/25, Critical
- Exploit status: theoretical, no public exploit code at the time of the advisory
The part that earns the score is in the risk vector: low access complexity, and no authentication required. The advisory also says all module configurations are potentially exploitable, so there is no "only if you enabled setting X" escape hatch.
Why a preview endpoint matters
A preview endpoint exists so the editor can render what a snippet will look like before saving. That makes it a route that takes user-supplied text and returns markup. Reflected XSS appears when that response echoes input back without proper validation or escaping, and the victim only has to follow a crafted link. The advisory does not describe the exact payload, and I have not tried to reproduce one, so I will not guess at it.
What I take from it is a general lesson: editor helper routes are easy to forget. They are not nodes, they do not show up in your content model, and you rarely review them when you audit permissions. Yet they are real HTTP routes, and a reachable one with weak input handling is as exposed as any form.
What I would do
- Check whether it is installed:
composer show drupal/highlight_jsordrush pm:list --filter=highlight. - If it is, update to 1.3.1 or later:
composer update drupal/highlight_js --with-dependencies, then clear caches. - If you cannot update today, uninstall the module. Code blocks already stored in content are plain markup and will simply lose their colouring.
- Look at the rest of the list of modules that touch CKEditor on your site. A tidy editor toolbar tends to hide a lot of extra routes.
This one came out in the same 4 November batch as several other Critical contrib advisories, so if you only skim the headline items you may have missed it.
The advisory lists Drew Webber and André Angelantoni of the Drupal Security Team as reporters, with a fix by Norman Kämper-Leymann.
My takeaway is a small one. "Cosmetic" modules deserve the same update discipline as the ones that look dangerous, because the attacker does not care what the module is for, only whether a route answers. I would rather spend a minute on a version bump than an hour explaining a reflected link in a client's inbox.