Real Name module: user-controlled Twig injection
Most Twig injection advisories I read involve a template field an editor can reach. SA-CONTRIB-2026-336, published on November 11, is a quieter variant: a module that builds a display name from a pattern, and a user who controls a piece of that pattern's input. The module is Real Name (realname), the CVE is CVE-2026-126745, and the fix is version 2.0.1.
What the advisory says
Real Name lets a site show users by a configurable pattern assembled from tokens, instead of the raw username. According to the advisory, it did not adequately sanitize user input in those patterns. A user could put Twig syntax into their own profile data, and that syntax was evaluated when their name was displayed. Affected versions are everything before 2.0.1.
The Drupal Security Team rated it Moderately critical (10/25). The scoring is worth reading rather than skimming: access complexity basic, authentication user-level, confidentiality impact "some non-public data released", integrity impact none, exploit maturity theoretical, and target distribution "default configurations are exploitable". It is not an RCE headline, and I am not going to pretend it is.
The precondition that decides whether you care
The advisory is explicit that exploitation needs two things at once: the site's name pattern must include user-supplied data, and the attacker must be able to edit that data on their own account. A pattern built only from fields the user cannot change is not exposed in the way described.
That is a concrete audit I can do in five minutes. Open the Real Name configuration, look at which tokens are in the pattern, and then check whether each one maps to a field that authenticated users can edit on their own profile. A "first name" or "nickname" token on a site with open registration is exactly the shape the advisory warns about. A token backed by a field only staff can edit is not.
What the fix does to your data
The solution section says to upgrade to Real Name 2.0.1, and adds a detail that is easy to miss: stored real names are cleared on update and regenerated by the corrected code. That makes sense, because the module stores the computed name. Patching the code alone would leave previously stored, already-poisoned values lying around, so clearing them is the right call. It also means the update does real work on a large user table, so I would run it on a copy first and watch how long the regeneration takes before doing it on production.
The credits are worth a nod: reported by Shawn Smiley, fixed by Lucas Hedding, Phill Tran and Shawn Smiley, and coordinated by the Drupal Security Team.
My takeaway
The lesson I keep relearning is that "display name" is a rendering path, not a harmless string. Anything that composes output from user-controlled input and then hands it to a template engine deserves the same suspicion as a comment field. If you run Real Name, upgrade to 2.0.1 and check your token list. If you do not, it is still a good prompt to grep your own custom code for places where user data is concatenated into something that later gets rendered as a template.